summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2015-08-07 16:56:18 +0900
committerTaeyoung Kim <ty317.kim@samsung.com>2015-11-11 21:34:58 -0800
commit53b6e23620df65cc75805e2740eb21c929d8d4b7 (patch)
tree8b69b0bf7571cd4d6329faa23861183b43ca44c2
parent62199c36b4cd7a84fd5b92df94f6c696ebb82ba7 (diff)
downloadlibsvi-53b6e23620df65cc75805e2740eb21c929d8d4b7.tar.gz
libsvi-53b6e23620df65cc75805e2740eb21c929d8d4b7.tar.bz2
libsvi-53b6e23620df65cc75805e2740eb21c929d8d4b7.zip
feedback: Fix memory leak of vibrator buffer
Change-Id: Ica99bae43bc7f7c928858696cf92133bfb736958 Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
-rw-r--r--src/parser.c1
-rw-r--r--src/vibrator.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index 671bcec..ce25289 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -215,4 +215,5 @@ void feedback_free_config(struct feedback_config_info *info)
}
free(info->data);
+ info->data = NULL;
}
diff --git a/src/vibrator.c b/src/vibrator.c
index e827e3f..0b2cd50 100644
--- a/src/vibrator.c
+++ b/src/vibrator.c
@@ -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));