summaryrefslogtreecommitdiff
path: root/src/libmtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmtp.c')
-rwxr-xr-xsrc/libmtp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libmtp.c b/src/libmtp.c
index ae9c088..c329034 100755
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -9342,6 +9342,11 @@ int LIBMTP_Get_Object_Handles(LIBMTP_mtpdevice_t *device, uint32_t storage,
*object_list = (uint32_t *)malloc(currentHandles.n * sizeof(int));
if (*object_list == NULL) {
LIBMTP_INFO("object list is NULL");
+ if (currentHandles.Handler != NULL) {
+ free(currentHandles.Handler);
+ currentHandles.Handler = NULL;
+ }
+
return -4;
}