Changeset 54a3c4d in rtems


Ignore:
Timestamp:
Jun 21, 2010, 4:27:12 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10
Children:
0dc6477
Parents:
bec8f2b
Message:

2010-06-21 Joel Sherrill <joel.sherrilL@…>

PR 1554/cpukit
Coverity Id 17

  • libi2c/libi2c.c: Fix memory leak on error.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rbec8f2b r54a3c4d  
     12010-06-21      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        PR 1554/cpukit
     4        Coverity Id 17
     5        * libi2c/libi2c.c: Fix memory leak on error.
     6
    172010-06-21      Joel Sherrill <joel.sherrilL@OARcorp.com>
    28
  • cpukit/libi2c/libi2c.c

    rbec8f2b r54a3c4d  
    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  }
     
    401402  if (!stat (nmcpy, &sbuf)) {
    402403    safe_printf ( DRVNM "Bad name: file exists already\n");
     404    free( nmcpy );
    403405    return -RTEMS_INVALID_NAME;
    404406  }
     
    413415    safe_printf ( DRVNM "Get %s status failed: %s\n",
    414416             nmcpy, strerror(errno));
     417    free( nmcpy );
    415418    return -RTEMS_INVALID_NAME;
    416419  }
     
    420423  if (libmutex == RTEMS_ID_NONE) {
    421424    safe_printf ( DRVNM "Library not initialized\n");
     425    free( nmcpy );
    422426    return -RTEMS_NOT_DEFINED;
    423427  }
     
    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  }
Note: See TracChangeset for help on using the changeset viewer.