Skip to content

Commit

Permalink
Fix introduced problem in asn_internal.c
Browse files Browse the repository at this point in the history
Previous commit was wrong - va_end(args) is called once, and right where it belongs.
  • Loading branch information
mouse07410 authored Dec 26, 2023
1 parent 57d97b4 commit 522ff88
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions skeletons/asn_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 522ff88

Please sign in to comment.