Show
Ignore:
Timestamp:
06/20/09 12:04:52 (5 years ago)
Author:
khali
Message:

libsensors: New method to free the memory allocated for the internal
representation of chip names.
sensord, sensors: Fix a memory leak when one or more chip names are
provided on the command line.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/libsensors.3

    r5654 r5740  
    4343.BI "int sensors_parse_chip_name(const char *" orig_name "," 
    4444.BI "                            sensors_chip_name *" res ");" 
     45.BI "void sensors_free_chip_name(sensors_chip_name *" chip ");" 
    4546.BI "int sensors_snprintf_chip_name(char *" str ", size_t " size "," 
    4647.BI "                               const sensors_chip_name *" chip ");" 
     
    102103.B sensors_parse_chip_name() 
    103104parses a chip name to the internal representation. Return 0 on success, 
    104 <0 on error. 
     105<0 on error. Make sure to call sensors_free_chip_name() when you're done 
     106with the data. 
     107 
     108.B sensors_free_chip_name() 
     109frees the memory that may have been allocated for the internal 
     110representation of a chip name. You only have to call this for chip 
     111names which do not originate from libsensors itself (that is, chip 
     112names which were generated by sensors_parse_chip_name()). 
    105113 
    106114.B sensors_snprintf_chip_name()