Unverified Commit 522ff88b authored by Mouse's avatar Mouse Committed by GitHub

Fix introduced problem in asn_internal.c

Previous commit was wrong - va_end(args) is called once, and right where it belongs.
parent 57d97b4e
......@@ -18,7 +18,6 @@ asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key,
if(wrote < (ssize_t)buf_size) {
if(wrote < 0) {
if(buf != scratch) FREEMEM(buf);
va_end(args);
return -1;
}
break;
......@@ -28,14 +27,12 @@ asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key,
if(buf == scratch) {
buf = MALLOC(buf_size);
if(!buf) {
va_end(args);
return -1;
}
} else {
void *p = REALLOC(buf, buf_size);
if(!p) {
FREEMEM(buf);
va_end(args);
return -1;
}
buf = p;
......@@ -44,7 +41,6 @@ asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key,
cb_ret = cb(buf, wrote, key);
if(buf != scratch) FREEMEM(buf);
va_end(args);
if(cb_ret < 0) {
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment