mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-01-15 22:05:43 +00:00
swtpm: Fix double free in error path
On error, the caller will call options_value_free() so don't free
ovs->options to avoid a double free.
Fixes: c94a1c4cbd ("swtpm: Fix memory leak in case realloc fails")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
This commit is contained in:
parent
8655c6f8ec
commit
f237f9f0b4
@ -89,7 +89,6 @@ option_value_add(OptionValues *ovs, const OptionDesc optdesc, const char *val,
|
||||
|
||||
tmp = realloc(ovs->options, (idx + 1) * sizeof(*ovs->options));
|
||||
if (!tmp) {
|
||||
free(ovs->options);
|
||||
option_error_set(error, "Out of memory");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user