X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fvirt.c;h=1c86a3dd1e62dee901b4c482203b8b3a3e91839b;hb=1210bc667d2d133814a0eb3cbcfcfb7e721fba9f;hp=78016eec8927d3e3245141e9f11144dfd8566401;hpb=b1b8e8169496d3c4f991de9a9d2975ffada6fa0f;p=elogind.git diff --git a/src/shared/virt.c b/src/shared/virt.c index 78016eec8..1c86a3dd1 100644 --- a/src/shared/virt.c +++ b/src/shared/virt.c @@ -62,7 +62,7 @@ int detect_vm(const char **id) { union { uint32_t sig32[3]; char text[13]; - } sig; + } sig = {}; unsigned i; const char *j, *k; bool hypervisor; @@ -84,7 +84,6 @@ int detect_vm(const char **id) { return r; /* http://lwn.net/Articles/301888/ */ - zero(sig); #if defined (__i386__) #define REG_a "eax" @@ -169,7 +168,7 @@ int detect_vm(const char **id) { } int detect_container(const char **id) { - char *e = NULL; + _cleanup_free_ char *e = NULL; int r; /* Unfortunately many of these operations require root access @@ -217,8 +216,6 @@ int detect_container(const char **id) { *id = "other"; } - free(e); - return r; }