On a Monday in 2023, Michal Privoznik wrote:
There are few places where the following pattern occurs:

 if (var)
     other = g_strdup(var);

where @other wasn't initialized before g_strdup(). Checking for
var != NULL is useless in this case, as that's exactly what
g_strdup() does (in which case it returns NULL).

Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
---
src/conf/domain_event.c      | 3 +--
src/libxl/libxl_conf.c       | 6 ++----
src/lxc/lxc_native.c         | 3 +--
src/qemu/qemu_monitor_json.c | 3 +--
src/util/virconf.c           | 3 +--
5 files changed, 6 insertions(+), 12 deletions(-)


Reviewed-by: Ján Tomko <jto...@redhat.com>

Jano

Attachment: signature.asc
Description: PGP signature

Reply via email to