diff --git a/programs/dwg2SVG.c b/programs/dwg2SVG.c index 6f08eaf1e..f932a36ce 100644 --- a/programs/dwg2SVG.c +++ b/programs/dwg2SVG.c @@ -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 diff --git a/programs/escape.c b/programs/escape.c index eeaa8f393..988c76a34 100644 --- a/programs/escape.c +++ b/programs/escape.c @@ -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;