summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaesub kim <taesub.kim@samsung.com>2016-06-13 02:19:17 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2016-06-13 02:19:17 (GMT)
commitba4685e28396ee6713aee92bf1c58f2ab104f08a (patch)
treeb597f1d81f7953c0e7ed961e6dfdd2d23f9eab71
parentce2e892c7acf909461f8cff41e813218e92e0bca (diff)
parent4a71625eba90f2199e11915bbd39fc214396f926 (diff)
downloadconnman-ba4685e28396ee6713aee92bf1c58f2ab104f08a.zip
connman-ba4685e28396ee6713aee92bf1c58f2ab104f08a.tar.gz
connman-ba4685e28396ee6713aee92bf1c58f2ab104f08a.tar.bz2
Merge "[upstream] Fix memory leak when realloc fails." into tizen
-rwxr-xr-xsrc/inet.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/inet.c b/src/inet.c
index bfad01c..972fdff 100755
--- a/src/inet.c
+++ b/src/inet.c
@@ -2706,7 +2706,14 @@ char **__connman_inet_get_running_interfaces(void)
g_free(ifr);
if (count < numif)
+ {
+ char **prev_result = result;
result = g_try_realloc(result, (count + 1) * sizeof(char *));
+ if (!result) {
+ g_free(prev_result);
+ goto error;
+ }
+ }
return result;