nfs_creat_async: plug potential memleak
[deb_libnfs.git] / 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;