nfs_mknod_async: fix use-after-free
authorArne Redlich <arne.redlich@googlemail.com>
Mon, 17 Feb 2014 22:53:38 +0000 (23:53 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 20 Feb 2014 02:54:58 +0000 (18:54 -0800)
Spotted by clang analyzer

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

index 910e4d2cc5a1b054a22d4df4dcd9789324c96b6f..c660db3ecf11211c732003e2abb686459b01c5c0 100644 (file)
@@ -2594,7 +2594,6 @@ int nfs_mknod_async(struct nfs_context *nfs, const char *path, int mode, int dev
        /* data->path now points to the parent directory,  and beyond the nul terminateor is the new directory to create */
        if (nfs_lookuppath_async(nfs, cb_data->path, cb, private_data, nfs_mknod_continue_internal, cb_data, free_mknod_cb_data, 0) != 0) {
                rpc_set_error(nfs->rpc, "Out of memory: failed to start parsing the path components");
-               free_mknod_cb_data(cb_data);
                return -1;
        }