X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibnfs.c;h=b26472c0ee384ca55101667b318136fbf05931db;hb=2257433dd4871b4d2323d92e5800931c6821b143;hp=9dbd2349b806940ecacb3e8a9608a2691cb7a059;hpb=a26bebefcedcaffd508a769eb4366484cdd0d635;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 9dbd234..b26472c 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -2124,6 +2124,7 @@ int nfs_mkdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void * ptr = strrchr(new_path, '/'); if (ptr == NULL) { + free(new_path); rpc_set_error(nfs->rpc, "Invalid path %s", path); return -1; } @@ -2210,6 +2211,7 @@ int nfs_rmdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void * ptr = strrchr(new_path, '/'); if (ptr == NULL) { + free(new_path); rpc_set_error(nfs->rpc, "Invalid path %s", path); return -1; } @@ -2594,7 +2596,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; } @@ -3312,7 +3313,6 @@ int nfs_fchmod_async(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode, nfs memcpy(data->fh.data.data_val, nfsfh->fh.data.data_val, data->fh.data.data_len); if (nfs_chmod_continue_internal(nfs, data) != 0) { - free_nfs_cb_data(data); return -1; } @@ -3447,7 +3447,6 @@ int nfs_fchown_async(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int memcpy(data->fh.data.data_val, nfsfh->fh.data.data_val, data->fh.data.data_len); if (nfs_chown_continue_internal(nfs, data) != 0) { - free_nfs_cb_data(data); return -1; }