summaryrefslogtreecommitdiffstats
path: root/trace
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-03-28 15:41:58 +0100
committerJohn Crispin <blogic@openwrt.org>2015-03-28 18:35:21 +0100
commit91da63d3d3fd680c805dd1a1b78df5b8731a8173 (patch)
treeec9a568a398ae536ccf7ac89a23942a60ef25c98 /trace
parent74d835463e05e5761f6f5271e487f299f29d3f07 (diff)
downloadunitd-91da63d3d3fd680c805dd1a1b78df5b8731a8173.tar
unitd-91da63d3d3fd680c805dd1a1b78df5b8731a8173.zip
properly handle return codes
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'trace')
-rw-r--r--trace/trace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/trace/trace.c b/trace/trace.c
index c6f32d7..12f0ee6 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -214,7 +214,8 @@ int main(int argc, char **argv, char **envp)
uloop_done();
if (!json)
- asprintf(&json, "/tmp/%s.%u.json", basename(*argv), child);
+ if (asprintf(&json, "/tmp/%s.%u.json", basename(*argv), child) < 0)
+ ERROR("failed to allocate output path: %s\n", strerror(errno));
print_syscalls(policy, json);