1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix memory leak of allocated bitmap in error path

Found by static analyzer.
This commit is contained in:
Zdenek Kabelac 2011-09-06 18:15:43 +00:00
parent 7b83071708
commit b647de3e07
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
Fix error path bitmap leak in cmirrord import_checkpoint().
Log unlink() error in cmirrord remove_lockfile().
Remove incorrect requirement for -j or -m from lvchange error message.
Fix unsafe table load when splitting off smaller mirror from a larger one.

View File

@ -619,6 +619,7 @@ open_retry:
if (rv != SA_AIS_OK) {
LOG_ERROR("[%s] Failed to open checkpoint: %s",
SHORT_UUID(entry->name.value), str_ais_error(rv));
free(bitmap);
return -EIO; /* FIXME: better error */
}
@ -647,6 +648,7 @@ init_retry:
if (rv != SA_AIS_OK) {
LOG_ERROR("[%s] Sync checkpoint section creation failed: %s",
SHORT_UUID(entry->name.value), str_ais_error(rv));
free(bitmap);
return -EIO; /* FIXME: better error */
}