On 11/15/24 4:19 AM, Michal Prívozník wrote:
On 11/13/24 18:39, Stefan Berger wrote:
> + swtpm, exitstatus, stderr_buf);
> + return -1;
> + }
> +
> + if (!(object = virJSONValueFromString(stdout_buf)))
> + return -1;
> +
> + if (!(active_profile = virJSONValueObjectGetObject(object,
"ActiveProfile")))
> + return -1;
> +
> + profile_name = g_strdup(virJSONValueObjectGetString(active_profile,
"Name"));
This g_strdup() looks suspicios and surely must lead to a memleak.
Correct, one too many g_strdup's here.
> +
> + g_free(emulator->profile_name);
> + emulator->profile_name = g_strdup(profile_name);
> +
> + *saveDef = true;
> + g_free(persistentTPMDef->data.emulator.profile_name);
> + persistentTPMDef->data.emulator.profile_name = g_strdup(profile_name);
> +
> + return 0;
> +}
> +
Michal