Skip to content

Commit

Permalink
squashme: fix failed torture test
Browse files Browse the repository at this point in the history
=== Start of file stderr970
 LIMIT tool_operate.c:1022 strdup reached memlimit
 curl: (27) Out of memory
=== End of file stderr970
  • Loading branch information
jay committed Feb 1, 2021
1 parent 1948ecf commit b042dfd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/tool_writeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,16 @@ static int writeString(FILE *stream, const struct writeoutvar *wovar,
}
break;
case VAR_EFFECTIVE_FILENAME:
strinfo = per->outs.filename;
valid = true;
if(per->outs.filename) {
strinfo = per->outs.filename;
valid = true;
}
break;
case VAR_INPUT_URL:
strinfo = per->this_url;
valid = true;
if(per->this_url) {
strinfo = per->this_url;
valid = true;
}
break;
default:
DEBUGASSERT(0);
Expand All @@ -200,6 +204,7 @@ static int writeString(FILE *stream, const struct writeoutvar *wovar,
}

if(valid) {
DEBUGASSERT(strinfo);
if(use_json) {
fprintf(stream, "\"%s\":\"", wovar->name);
jsonWriteString(stream, strinfo);
Expand Down

0 comments on commit b042dfd

Please sign in to comment.