]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MergeDiff.cc: close 'sd' correctly at the end of do_merge_diff()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 28 Jan 2016 10:46:08 +0000 (11:46 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 20:51:17 +0000 (21:51 +0100)
Fix for:

CID 1265562 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_handle: Handle variable sd going out of scope leaks the handle.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/tools/rbd/action/MergeDiff.cc

index f56ec1f27d02569826eef26a7fecbfb265f5e174..7289e11c41df0c0f05a66bcd8ee54b6c5ee6cc8e 100644 (file)
@@ -377,7 +377,7 @@ static int do_merge_diff(const char *first, const char *second,
 done:
   if (pd > 2)
     close(pd);
-  if (sd > 2)
+  if (sd)
     close(sd);
   if (fd > 2)
     close(fd);