projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6daca3
)
trace: free string returned by blobmsg_format_json_indent()
author
Daniel Golle
<daniel@makrotopia.org>
Mon, 23 Aug 2021 17:07:19 +0000
(18:07 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Tue, 24 Aug 2021 17:31:56 +0000
(18:31 +0100)
Coverity CID:
1446205
Resource leak
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
trace/trace.c
patch
|
blob
|
history
diff --git
a/trace/trace.c
b/trace/trace.c
index dab92e06c4275e35e2f0dee2d0f16b79ad0b29a9..eec21f8b744e22cc6d3891df202faa6daaf87906 100644
(file)
--- a/
trace/trace.c
+++ b/
trace/trace.c
@@
-117,6
+117,7
@@
static void print_syscalls(int policy, const char *json)
{
void *c, *d, *e;
int i;
+ char *tmp;
if (mode == UTRACE) {
set_syscall("rt_sigaction", 1);
@@
-168,8
+169,12
@@
static void print_syscalls(int policy, const char *json)
ULOG_ERR("failed to open %s\n", json);
}
} else {
- printf("%s\n",
- blobmsg_format_json_indent(b.head, true, 0));
+ tmp = blobmsg_format_json_indent(b.head, true, 0);
+ if (!tmp)
+ return;
+
+ printf("%s\n", tmp);
+ free(tmp);
}
}