]> xenbits.xensource.com Git - libvirt.git/commitdiff
virGetStorageVol: Don't ignore NULL pool name
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 10 May 2013 10:05:28 +0000 (12:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 May 2013 10:05:28 +0000 (12:05 +0200)
The function takes pool name as argument. However,
it is not acceptable for it to be NULL. Hence, we
should check it and report error in case it is.

src/datatypes.c

index f815b6c861c76ce906cdf09a0b1cb4b01e11de05..884eb3e95482a1fbfe78b30cfc8e2f7752ee10b9 100644 (file)
@@ -520,6 +520,7 @@ virGetStorageVol(virConnectPtr conn, const char *pool, const char *name,
         virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
         return NULL;
     }
+    virCheckNonNullArgReturn(pool, NULL);
     virCheckNonNullArgReturn(name, NULL);
     virCheckNonNullArgReturn(key, NULL);