]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mount.ceph.c: free memory before return
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 4 Sep 2014 11:57:58 +0000 (13:57 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 4 Sep 2014 11:57:58 +0000 (13:57 +0200)
CID 1219610 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable buf going out of scope leaks the
  storage it points to.
 leaked_storage: Variable mount_path going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mount/mount.ceph.c

index e34cbd050145e5ac13f576298a165ba05527ab2b..5c8bf959c37e8afed9477b9b6e7b19d7813b3ba9 100644 (file)
@@ -65,8 +65,10 @@ static char *mount_resolve_src(const char *orig_str)
        }
 
        src = resolve_addrs(buf);
-       if (!src)
+       if (!src) {
+               free(buf);
                return NULL;
+       }
 
        len = strlen(src);
        pos = safe_cat(&src, &len, len, ":");