commit | bb9b198da07e1f690b1c5e02b9655fb550c0ada5 | [log] [tgz] |
---|---|---|
author | Radek Krejci <rkrejci@cesnet.cz> | Mon Apr 08 14:24:59 2019 +0200 |
committer | Radek Krejci <rkrejci@cesnet.cz> | Mon Apr 08 14:24:59 2019 +0200 |
tree | fbc3e025125431e9ea7aac7e68d8263e4cafc0bd | |
parent | b07b5c9f5467ab5865198d05aee24cc66ae6de7c [diff] [blame] |
BUGFIX memory leaks
diff --git a/src/xml.c b/src/xml.c index 8fa1c7e..df8a829 100644 --- a/src/xml.c +++ b/src/xml.c
@@ -350,7 +350,12 @@ LOGVAL(ctx, LY_VLOG_LINE, &context->line, LY_VCODE_EOF); error: if (!(*buffer)) { + /* buffer not provided, buf is local */ free(buf); + } else if (buf) { + /* buf is shared with caller via buffer, but buf could be reallocated, so update the provided buffer */ + (*buffer) = buf; + (*buffer_size) = size; } return LY_EVALID;