On 10.05.2013 09:57, Ján Tomko wrote: > On 05/03/2013 04:53 PM, Michal Privoznik wrote: >> --- >> src/datatypes.c | 76 +++++++++++++++++++++++++++------------------------------ >> src/libvirt.c | 14 +++-------- >> src/nodeinfo.c | 5 +--- >> 3 files changed, 41 insertions(+), 54 deletions(-) >> >> @@ -530,12 +528,10 @@ virGetStorageVol(virConnectPtr conn, const char *pool, const char *name, >> if (!(ret = virObjectNew(virStorageVolClass))) >> return NULL; >> >> - if (!(ret->pool = strdup(pool))) >> - goto no_memory; >> - if (!(ret->name = strdup(name))) >> - goto no_memory; >> - if (!(ret->key = strdup(key))) >> - goto no_memory; >> + if (VIR_STRDUP(ret->pool, pool) < 0 || >> + VIR_STRDUP(ret->name, name) < 0 || >> + VIR_STRDUP(ret->key, key) < 0) >> + goto error; >> >> ret->conn = virObjectRef(conn); >> > > VIR_STRDUP accepts NULL now, you should check if pool is non-null as well. Yeah, we should add: --- a/src/datatypes.c +++ b/src/datatypes.c @@ -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); But I think that deserves a separate patch. > > ACK > > Jan > -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list