projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
236c2b4
)
[upstream] Fix memory leak when realloc fails.
07/73807/2
author
Niraj Kumar Goit
<niraj.g@samsung.com>
Thu, 9 Jun 2016 17:25:39 +0000
(22:55 +0530)
committer
Niraj Kumar Goit
<niraj.g@samsung.com>
Fri, 10 Jun 2016 08:13:24 +0000
(13:43 +0530)
Change-Id: I9d34aa90a0ad2265339b3a05302bbe5b5f1ba211
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
src/inet.c
patch
|
blob
|
history
diff --git
a/src/inet.c
b/src/inet.c
index
bfad01c
..
972fdff
100755
(executable)
--- 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;