Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
if (S_ISDIR(st->st_mode)) {
vol->type = VIR_STORAGE_VOL_NETDIR;
vol->target.format = VIR_STORAGE_FILE_DIR;
- *volptr = vol;
- vol = NULL;
+ VIR_STEAL_PTR(*volptr, vol);
ret = 0;
goto cleanup;
}
vol->target.compat = meta->compat;
meta->compat = NULL;
- *volptr = vol;
- vol = NULL;
+ VIR_STEAL_PTR(*volptr, vol);
ret = 0;
cleanup:
virStorageSourceFree(meta);