nfs_opendir2_cb: plug potential memleaks
Spotted by clang analyzer Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>libnfs-4.0.0-vitalif
parent
2fa14f9b97
commit
a26bebefce
|
@ -2729,6 +2729,7 @@ static void nfs_opendir2_cb(struct rpc_context *rpc, int status, void *command_d
|
|||
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);
|
||||
|
@ -2788,6 +2789,9 @@ static void nfs_opendir2_cb(struct rpc_context *rpc, int status, void *command_d
|
|||
* commands in flight to complete
|
||||
*/
|
||||
if (rdpe_cb_data->getattrcount > 0) {
|
||||
nfs_free_nfsdir(nfsdir);
|
||||
data->continue_data = NULL;
|
||||
free_nfs_cb_data(data);
|
||||
rdpe_cb_data->status = RPC_STATUS_ERROR;
|
||||
free(rdpe_lookup_cb_data);
|
||||
return;
|
||||
|
@ -2805,7 +2809,6 @@ static void nfs_opendir2_cb(struct rpc_context *rpc, int status, void *command_d
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void nfs_opendir_cb(struct rpc_context *rpc, int status, void *command_data, void *private_data)
|
||||
{
|
||||
READDIRPLUS3res *res = command_data;
|
||||
|
|
Loading…
Reference in New Issue