freemyipod r786 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r785‎ | r786 | r787 >
Date:14:58, 18 November 2011
Author:user890104
Status:new
Tags:
Comment:
emCOREFS: fix a couple more memleaks (thanks to cppcheck), also a x64 int formatting issue.
Modified paths:
  • /emcore/trunk/tools/emcorefs/emcore.c (modified) (history)
  • /emcore/trunk/tools/emcorefs/usb.c (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcorefs/usb.c
@@ -82,7 +82,7 @@
8383 }
8484
8585 #ifdef DEBUG
86 - fprintf(stderr, "Found %d USB devices!\n", devs_cnt);
 86+ fprintf(stderr, "Found %ld USB devices!\n", devs_cnt);
8787 #endif
8888 for (i = 0; i < devs_cnt; ++i)
8989 {
Index: emcore/trunk/tools/emcorefs/emcore.c
@@ -225,11 +225,15 @@
226226
227227 if (EMCORE_SUCCESS != res)
228228 {
 229+ free(in);
 230+
229231 return res;
230232 }
231233
232234 memcpy(data, in + EMCORE_HEADER_SIZE, size);
233235
 236+ free(in);
 237+
234238 return EMCORE_SUCCESS;
235239 }
236240
@@ -332,11 +336,15 @@
333337
334338 if (EMCORE_SUCCESS != res)
335339 {
 340+ free(in);
 341+
336342 return res;
337343 }
338344
339345 memcpy(data, in + 16, size);
340346
 347+ free(in);
 348+
341349 return EMCORE_SUCCESS;
342350 }
343351