summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunho Kang <hhstark.kang@samsung.com>2017-02-08 20:46:55 +0900
committerHyunho Kang <hhstark.kang@samsung.com>2017-02-08 20:47:23 +0900
commit0e683c2f9c8506b1347291f1cd8d87aa5300c232 (patch)
tree408f0fa4bd784da243ede7656d84bdd0ed954073
parent58dd1005133ddeee55d6554f553f0c030ec5c6cf (diff)
downloaddata-control-0e683c2f9c8506b1347291f1cd8d87aa5300c232.tar.gz
data-control-0e683c2f9c8506b1347291f1cd8d87aa5300c232.tar.bz2
data-control-0e683c2f9c8506b1347291f1cd8d87aa5300c232.zip
Fix memory leak
Change-Id: I90a27b350785dcafbbe7a7aed60d7db43da917b4 Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
-rwxr-xr-xsrc/data-control-provider.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/data-control-provider.c b/src/data-control-provider.c
index bc6d8c9..a0d8c73 100755
--- a/src/data-control-provider.c
+++ b/src/data-control-provider.c
@@ -596,7 +596,7 @@ out:
static bundle *__get_bundle_data_from_fd(int fd)
{
- bundle *b = bundle_create();
+ bundle *b = NULL;
int len = 0;
int ret;
char *buf;
@@ -604,8 +604,6 @@ static bundle *__get_bundle_data_from_fd(int fd)
ret = read(fd, &len, sizeof(int));
if (ret < sizeof(int)) {
LOGE("read error :%d", ret);
- if (b)
- bundle_free(b);
return NULL;
}
LOGD("read len : %d", len);
@@ -614,15 +612,11 @@ static bundle *__get_bundle_data_from_fd(int fd)
buf = (char *)calloc(len, sizeof(char));
if (buf == NULL) {
LOGE("calloc fail");
- if (b)
- bundle_free(b);
return NULL;
}
ret = read(fd, buf, len);
if (ret < len) {
LOGE("read error :%d", ret);
- if (b)
- bundle_free(b);
if (buf)
free(buf);
return NULL;