nfs_mknod_async: plug potential memory leak
authorArne Redlich <arne.redlich@googlemail.com>
Mon, 17 Feb 2014 22:09:31 +0000 (23:09 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 20 Feb 2014 02:47:02 +0000 (18:47 -0800)
Pointed out by clang analyzer.

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

index 6e7cd214a3fefa3d47244048c1fc0db2c19cc674..64f7fe4b23f7ddb8fdd49b28bb511fe2969638e4 100644 (file)
@@ -2592,6 +2592,7 @@ int nfs_mknod_async(struct nfs_context *nfs, const char *path, int mode, int dev
        ptr = strrchr(cb_data->path, '/');
        if (ptr == NULL) {
                rpc_set_error(nfs->rpc, "Invalid path %s", path);
+               free_mknod_cb_data(cb_data);
                return -1;
        }
        *ptr = 0;