projects
/
platform
/
core
/
system
/
stability-monitor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e0cba0
)
Fix a coverity issue (var scope leak)
31/258431/1
author
Michal Bloch
<m.bloch@samsung.com>
Mon, 17 May 2021 17:28:21 +0000
(19:28 +0200)
committer
Michal Bloch
<m.bloch@samsung.com>
Mon, 17 May 2021 17:28:53 +0000
(19:28 +0200)
Change-Id: I9060ca07016f49fca0660d76fc92aa61fb53d8c3
src/utils.c
patch
|
blob
|
history
diff --git
a/src/utils.c
b/src/utils.c
index
194eeb0
..
05bd50b
100644
(file)
--- a/
src/utils.c
+++ b/
src/utils.c
@@
-131,10
+131,12
@@
int _json_object_object_merge(json_object *obj1, char *key, json_object *obj2_no
}
/* if obj1 and obj2 is json_object_type */
- json_object_object_foreach(obj2_node, k, v) {
- ret = _json_object_object_merge(obj1_node, k, v);
- if (ret)
- return ret;
+ { // the `foreach` leaks some variables into the local scope
+ json_object_object_foreach(obj2_node, k, v) {
+ ret = _json_object_object_merge(obj1_node, k, v);
+ if (ret)
+ return ret;
+ }
}
return 0;