Re: [PATCH v4 11/11] qemu: Read back the profile name after creation of a TPM instance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux