From: Zdenek Kabelac Date: Tue, 6 Sep 2011 18:15:43 +0000 (+0000) Subject: Fix memory leak of allocated bitmap in error path X-Git-Tag: old-v2_02_89~526 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=ebb39e10410976d54d25febe154bd322de6cbfde;p=lvm2.git Fix memory leak of allocated bitmap in error path Found by static analyzer. --- diff --git a/WHATS_NEW b/WHATS_NEW index e08460706..600402467 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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. diff --git a/daemons/cmirrord/cluster.c b/daemons/cmirrord/cluster.c index b6c925aa0..ad1d7dceb 100644 --- a/daemons/cmirrord/cluster.c +++ b/daemons/cmirrord/cluster.c @@ -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 */ }