Package: mtpfs
Version: 1.1-1
Severity: normal
Tags: upstream patch
Revealed by:
$ cppcheck mtpfs.c
Checking mtpfs.c...
[mtpfs.c:611]: (error) Possible null pointer dereference: item -
otherwise it is redundant to check if item is null at line 609
[mtpfs.c:992]: (error) Memory leak: path
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages mtpfs depends on:
ii fuse-utils 2.8.7-1
ii libc6 2.13-27
ii libfuse2 2.8.7-1
ii libglib2.0-0 2.32.0-3
ii libid3tag0 0.15.1b-10
ii libmad0 0.15.1b-7
ii libmtp9 1.1.3-1
ii libusb-1.0-0 2:1.0.9~rc3-4
ii zlib1g 1:1.2.6.dfsg-2
mtpfs recommends no packages.
mtpfs suggests no packages.
-- no debconf information
Cheers,
--
Cristian--- mtpfs.c.~1~ 2012-02-27 01:59:39.000000000 +0100
+++ mtpfs.c 2012-04-07 11:40:55.291749801 +0200
@@ -606,7 +606,7 @@
DBG("Problem sending %s - %d",path,ret);
}
// Cleanup
- if (item && item->data)
+ if (item->data)
g_free (item->data);
myfiles = g_slist_remove (myfiles, item->data);
g_strfreev (fields);
@@ -989,6 +989,7 @@
path = strcat (path,file->filename);
fprintf (filetmp,"%s\n",path);
DBG("%s\n",path);
+ g_free (name);
}
}
//LIBMTP_destroy_file_t(file);