Ticket #1554: pr1554.diff

File pr1554.diff, 1.3 KB (added by Joel Sherrill, on Jun 14, 2010 at 2:55:19 PM)

Should address issue

  • cpukit/libi2c/libi2c.c

    RCS file: /usr1/CVS/rtems/cpukit/libi2c/libi2c.c,v
    retrieving revision 1.16
    diff -u -r1.16 libi2c.c
     
    395395  /* check */
    396396  if ('/' != *nmcpy) {
    397397    safe_printf ( DRVNM "Bad name: must be an absolute path starting with '/'\n");
     398    free( nmcpy );
    398399    return -RTEMS_INVALID_NAME;
    399400  }
    400401  /* file must not exist */
    401402  if (!stat (nmcpy, &sbuf)) {
    402403    safe_printf ( DRVNM "Bad name: file exists already\n");
     404    free( nmcpy );
    403405    return -RTEMS_INVALID_NAME;
    404406  }
    405407
     
    412414  if (i) {
    413415    safe_printf ( DRVNM "Get %s status failed: %s\n",
    414416             nmcpy, strerror(errno));
     417    free( nmcpy );
    415418    return -RTEMS_INVALID_NAME;
    416419  }
    417420  /* should be a directory since name terminates in '/' */
     
    419422
    420423  if (libmutex == RTEMS_ID_NONE) {
    421424    safe_printf ( DRVNM "Library not initialized\n");
     425    free( nmcpy );
    422426    return -RTEMS_NOT_DEFINED;
    423427  }
    424428
    425429  if (bus == NULL || bus->size < sizeof (*bus)) {
    426430    safe_printf ( DRVNM "No bus-ops or size too small -- misconfiguration?\n");
     431    free( nmcpy );
    427432    return -RTEMS_NOT_CONFIGURED;
    428433  }
    429434