Both the option string for the 'redundancy' option and the
SheepdogRedundancy object that is created accordingly could be leaked in
error paths. This fixes the memory leaks.
Reported by Coverity (CID
1390614 and
1390641).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-id:
20180503153509.22223-1-kwolf@redhat.com
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
} else {
ret = qemu_strtol(n2, NULL, 10, &parity);
if (ret < 0) {
+ g_free(redundancy);
return NULL;
}
QDict *qdict, *location_qdict;
QObject *crumpled;
Visitor *v;
- const char *redundancy;
+ char *redundancy;
Error *local_err = NULL;
int ret;
fail:
qapi_free_BlockdevCreateOptions(create_options);
qobject_unref(qdict);
+ g_free(redundancy);
return ret;
}