]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mount.ceph.c: fix resource leak
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 20 Feb 2017 15:41:49 +0000 (16:41 +0100)
committerKefu Chai <kchai@redhat.com>
Mon, 10 Apr 2017 10:16:17 +0000 (18:16 +0800)
Addressed issue:

CID 1219611 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable saw_name 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 ab96970c312d339f7ada3ce96b30ce1268d439fc..5ead9313b7d4c264321040d079eb63ed14b2c064 100644 (file)
@@ -171,6 +171,7 @@ static char *parse_options(const char *data, int *filesys_flags)
                } else if (strncmp(data, "secret", 6) == 0) {
                        if (!value || !*value) {
                                printf("mount option secret requires a value.\n");
+                               free(saw_name);
                                return NULL;
                        }