diff options
author | Miloslav Trmač <mitr@redhat.com> | 2012-07-18 15:59:00 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2012-07-18 17:13:10 +0200 |
commit | 5b22de807871c25ed68071a64422f4c336fdc8d4 (patch) | |
tree | 7e604bc3257b96d61c625bb3f4d9bc4c39a6a4a8 | |
parent | ba8362e12b1615ff79f3cd4349211f47fcb1f325 (diff) | |
download | libumberlog-5b22de807871c25ed68071a64422f4c336fdc8d4.tar.gz libumberlog-5b22de807871c25ed68071a64422f4c336fdc8d4.tar.xz libumberlog-5b22de807871c25ed68071a64422f4c336fdc8d4.zip |
Fix a memory leak on error paths
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r-- | lib/umberlog.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/umberlog.c b/lib/umberlog.c index 722a4e8..b61b053 100644 --- a/lib/umberlog.c +++ b/lib/umberlog.c @@ -371,13 +371,12 @@ _ul_vformat (ul_buffer_t *buffer, int format_version, /* "&ap" may not be possible for function parameters, so make a copy. */ va_copy (ap, ap_orig); - value = _ul_vasprintf_and_advance (msg_format, &ap); - if (!value) - goto err; - if (ul_buffer_reset (buffer) != 0) goto err; + value = _ul_vasprintf_and_advance (msg_format, &ap); + if (!value) + goto err; buffer = ul_buffer_append (buffer, "msg", value); free (value); |