nfs_creat_async: plug potential memleak
authorArne Redlich <arne.redlich@googlemail.com>
Mon, 17 Feb 2014 22:11:59 +0000 (23:11 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 20 Feb 2014 02:47:27 +0000 (18:47 -0800)
Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
lib/libnfs.c

index 64f7fe4b23f7ddb8fdd49b28bb511fe2969638e4..969721e0330909f45e1906afba418d7b9c057c7e 100644 (file)
@@ -2371,6 +2371,7 @@ int nfs_creat_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb
        ptr = strrchr(new_path, '/');
        if (ptr == NULL) {
                rpc_set_error(nfs->rpc, "Invalid path %s", path);
+               free(new_path);
                return -1;
        }
        *ptr = 0;