OSDN Git Service

libsensors: Fix memory leak when sensors are enabled
authorAndy Ross <andy.ross@windriver.com>
Thu, 26 Sep 2013 18:29:09 +0000 (11:29 -0700)
committerMattias Pettersson <mattias.pettersson@intel.com>
Wed, 4 Dec 2013 14:13:12 +0000 (15:13 +0100)
commit9814fad2dba56be8946f6f42736333742c2b9104
tree900170b6a8554b19ac5a7c2b6326792dddb34a00
parent2a3f8eca06a7c42d01ce28a5a627fbc4972f548e
libsensors: Fix memory leak when sensors are enabled

BuildChannelList is called every time the sensor is opened, not simply
once on initialization.  The info_array would continually grow with
newly probed channel objects (i.e. 3 objects for
accelerometer/gyro/compass, one for ALS) appeneded every time, and it
was similarly used to size the raw_buffer used for the read() call.

Change-Id: I163fe2e3abddbd7196e90bc1774f6584b47ab3f4
For: AXIA-3287
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22149
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Russell Webb <russell.webb@intel.com>
Tested-by: jenkins autobuilder
common/libsensors/SensorIIODev.cpp