Changeset 9511a0ab in rtems


Ignore:
Timestamp:
Jun 21, 2010, 4:27:23 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.9
Children:
ca07e7d
Parents:
219298ad
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

    r219298ad r9511a0ab  
     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-03-17      Chris Johns <chrisj@rtems.org>
    28
  • cpukit/libi2c/libi2c.c

    r219298ad r9511a0ab  
    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) {
    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.