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:
Ross Lagerwall 2024-03-13 17:10:19 +00:00 committed by Stefan Berger
parent 8655c6f8ec
commit f237f9f0b4

View File

@ -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;
}