dev-mornfall-lvmcache - thin: fix resource leak in err path
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2b76a6f022920abd59072decfa7d3d76eeda913 Commit: a2b76a6f022920abd59072decfa7d3d76eeda913 Parent: 17a691505467cd5a73059fe5ca22fe50dafd345a Author: Zdenek Kabelac <[email protected]> AuthorDate: Sun Apr 21 12:19:25 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sun Apr 21 23:10:30 2013 +0200
thin: fix resource leak in err path
If the devices list could not have been obtained, FILE* was leaked.
--- WHATS_NEW | 1 + daemons/dmeventd/plugins/thin/dmeventd_thin.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Fix memleak in dmeventd thin plugin in device list obtaining err path. Add explicit message about unsupported pvmove for thin/thinpool volumes. Fix lvmetad error path in lvmetad_vg_lookup() for null vgname. Fix clvmd _cluster_request() return code in memory fail path.
daemons/dmeventd/plugins/thin/dmeventd_thin.c +3 -3
@@ -246,7 +246,7 @@ static void _umount(struct dm_task *dmt, const char *device) {static const char mountinfo[] ="/proc/self/mountinfo" ;static const size_t MINORS =4096 ; -FILE *minfo; +FILE *minfo =NULL ;char buffer[4096 ];char target[PATH_MAX ];struct dm_info info;
@@ -288,10 +288,10 @@ static void _umount(struct dm_task *dmt, const char *device) } } -if (fclose (minfo)) +out: +if (minfo &&fclose (minfo))syslog (LOG_ERR ,"Failed to close %s\n" , mountinfo); -out:if (minors)dm_bitset_destroy (minors);dmeventd_lvm2_lock ();