Skip to content

Commit

Permalink
escape: fix error: null destination pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Sep 30, 2024
1 parent 5a46475 commit 452d6ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion programs/dwg2SVG.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ output_TEXT (Dwg_Object *obj)
obj->index, transform_X (pt.x), transform_Y (pt.y), fontfamily,
text->height /* fontsize */, entity_color (obj->tio.entity),
escaped ? escaped : "");
free (escaped);
if (escaped)
free (escaped);
}

static void
Expand Down
2 changes: 2 additions & 0 deletions programs/escape.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ htmlescape (const char *restrict src, const Dwg_Codepage cp)
return NULL;
len = strlen (src) + 10;
d = (char *)calloc (len, 1);
if (!d)
return NULL;
s = (unsigned char *)src;
dest = d;
end = dest + len;
Expand Down

0 comments on commit 452d6ab

Please sign in to comment.