feedback: Fix memory leak of vibrator buffer 71/50571/2
authorJiyoung Yun <jy910.yun@samsung.com>
Fri, 7 Aug 2015 07:56:18 +0000 (16:56 +0900)
committerTaeyoung Kim <ty317.kim@samsung.com>
Thu, 12 Nov 2015 05:34:58 +0000 (21:34 -0800)
Change-Id: Ica99bae43bc7f7c928858696cf92133bfb736958
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
src/parser.c
src/vibrator.c

index 671bcec..ce25289 100644 (file)
@@ -215,4 +215,5 @@ void feedback_free_config(struct feedback_config_info *info)
        }
 
        free(info->data);
+       info->data = NULL;
 }
index e827e3f..0b2cd50 100644 (file)
@@ -326,6 +326,7 @@ static int vibrator_play(feedback_pattern_e pattern)
                ret = haptic_vibrate_buffer(v_handle, pbuf, size,
                                HAPTIC_ITERATION_ONCE,
                                level, get_priority(pattern));
+               free(pbuf);
        } else
                ret = haptic_vibrate_monotone(v_handle, DEFAULT_DURATION,
                                level, get_priority(pattern));