diff options
author | Gergely Nagy <algernon@balabit.hu> | 2012-03-22 13:39:20 +0100 |
---|---|---|
committer | Gergely Nagy <algernon@balabit.hu> | 2012-03-22 13:39:20 +0100 |
commit | 1c3b587b949bbaa19010fb4530282417015df4b6 (patch) | |
tree | 2c47c8dbff1a039eb381e383b423674f6ab5cbb7 /t | |
parent | bb11776e30a9f97ca807aa38a6eeeba5a7192f44 (diff) | |
download | libumberlog-1c3b587b949bbaa19010fb4530282417015df4b6.tar.gz libumberlog-1c3b587b949bbaa19010fb4530282417015df4b6.tar.xz libumberlog-1c3b587b949bbaa19010fb4530282417015df4b6.zip |
Check (v)asprintf() return values.
If (v)asprintf() returns an error, abort() away, because we can't
possibly proceed.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Diffstat (limited to 't')
-rw-r--r-- | t/test_cee_format.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/test_cee_format.c b/t/test_cee_format.c index ec48603..1d3a7a0 100644 --- a/t/test_cee_format.c +++ b/t/test_cee_format.c @@ -153,7 +153,8 @@ test_discover_priority (void) verify_value (jo, "msg", "testing 1, 2, 3..."); - asprintf (&pid, "%d", getpid ()); + if (asprintf (&pid, "%d", getpid ()) == -1) + abort (); verify_value (jo, "pid", pid); free (pid); |