From: Danny Al-Gaaf Date: Thu, 4 Sep 2014 11:57:58 +0000 (+0200) Subject: mount.ceph.c: free memory before return X-Git-Tag: v0.86~135^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f29e5b338233e39a2ecd59ae3b23d85e11ce7f27;p=ceph.git mount.ceph.c: free memory before return 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 --- diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c index e34cbd050145e..5c8bf959c37e8 100644 --- a/src/mount/mount.ceph.c +++ b/src/mount/mount.ceph.c @@ -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, ":");