virt plugin: compare pointer to NULL, not 0
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 16 Apr 2016 11:54:16 +0000 (13:54 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 16 Apr 2016 11:59:47 +0000 (13:59 +0200)
Found with coccinelle

src/virt.c

index bbf5afc..e5a8725 100644 (file)
@@ -687,7 +687,7 @@ refresh_lists (void)
 
         /* Get list of domains. */
         domids = malloc (sizeof (*domids) * n);
-        if (domids == 0) {
+        if (domids == NULL) {
             ERROR (PLUGIN_NAME " plugin: malloc failed.");
             return -1;
         }