Changeset a8b071db in rtems


Ignore:
Timestamp:
Nov 27, 2014, 3:28:42 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
8dbbea6b
Parents:
3a8566b7
Message:

rtems-bin2c.c: Fix free() of altered pointer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/build/rtems-bin2c.c

    r3a8566b7 ra8b071db  
    120120
    121121  /* find basename */
    122   char *ifbasename = strdup(ifname);
    123   if ( ifbasename == NULL ) {
     122  char *ifbasename_to_free = strdup(ifname);
     123  if ( ifbasename_to_free == NULL ) {
    124124    fprintf(stderr, "cannot allocate memory\n" );
    125125    fclose(ifile);
     
    129129  }
    130130
    131   ifbasename = basename(ifbasename);
     131  char *ifbasename;
     132  ifbasename = basename(ifbasename_to_free);
    132133
    133134  strcpy(buf, ifbasename);
     
    253254  if ( createC ) { fclose(ocfile); }
    254255  if ( createH ) { fclose(ohfile); }
    255   free(ifbasename);
     256  free(ifbasename_to_free);
    256257}
    257258
Note: See TracChangeset for help on using the changeset viewer.