From: Arne Redlich Date: Mon, 17 Feb 2014 21:44:47 +0000 (+0100) Subject: nfs_opendir_cb: plug potential memory leak X-Git-Tag: upstream/1.9.6^2~105 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=b2fc5c54d9510d2f83d556ef871fc0ce3a2fb582 nfs_opendir_cb: plug potential memory leak Spotted by clang analyzer. Signed-off-by: Arne Redlich --- diff --git a/lib/libnfs.c b/lib/libnfs.c index 572cd78..61cb29f 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -2876,6 +2876,7 @@ static void nfs_opendir_cb(struct rpc_context *rpc, int status, void *command_da nfsdirent->name = strdup(entry->name); if (nfsdirent->name == NULL) { data->cb(-ENOMEM, nfs, "Failed to allocate dirent->name", data->private_data); + free(nfsdirent); nfs_free_nfsdir(nfsdir); data->continue_data = NULL; free_nfs_cb_data(data);