diff options
author | Hyunho Kang <hhstark.kang@samsung.com> | 2017-02-08 20:46:55 +0900 |
---|---|---|
committer | Hyunho Kang <hhstark.kang@samsung.com> | 2017-02-08 20:47:23 +0900 |
commit | 0e683c2f9c8506b1347291f1cd8d87aa5300c232 (patch) | |
tree | 408f0fa4bd784da243ede7656d84bdd0ed954073 | |
parent | 58dd1005133ddeee55d6554f553f0c030ec5c6cf (diff) | |
download | data-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-x | src/data-control-provider.c | 8 |
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; |