mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
storage_conf: plug a leak on OOM error path
* src/conf/storage_conf.c (virStoragePoolSourceListNewSource): Free just-allocated "source" upon VIR_REALLOC_N failure.
This commit is contained in:
parent
4bc3bd7b18
commit
3aa13a471a
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* storage_conf.c: config handling for storage driver
|
||||
*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2010 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2008 Daniel P. Berrange
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@ -1695,6 +1695,7 @@ virStoragePoolSourceListNewSource(virConnectPtr conn,
|
||||
}
|
||||
|
||||
if (VIR_REALLOC_N(list->sources, list->nsources+1) < 0) {
|
||||
VIR_FREE(source);
|
||||
virReportOOMError(conn);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user