]> granicus.if.org Git - graphviz/commitdiff
gml2gv gmlscan: fix unchecked allocation failures
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 28 Aug 2022 16:09:10 +0000 (09:09 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 30 Aug 2022 04:01:31 +0000 (21:01 -0700)
cmd/tools/gmlscan.l

index fa955b2a5cb47dccd312a1aa4bd40633ae477b48..82adc32056bab7501d82f813452b67a0ffb4ed91 100644 (file)
@@ -110,9 +110,9 @@ L_ID      [a-zA-Z_][_a-zA-Z0-9]*
 "fontSize"                  return (FONTSIZE);
 "fontName"                  return (FONTNAME);
 "color"                     return (COLOR);
-{L_INT}                     { gmllval.str = strdup(yytext); return (INTEGER); }
-{L_REAL}                    { gmllval.str = strdup(yytext); return (REAL); }
-{L_ID}                      { gmllval.str = strdup(yytext); return (NAME); }
+{L_INT}                     { gmllval.str = gv_strdup(yytext); return (INTEGER); }
+{L_REAL}                    { gmllval.str = gv_strdup(yytext); return (REAL); }
+{L_ID}                      { gmllval.str = gv_strdup(yytext); return (NAME); }
 ["]                         BEGIN(qstring); beginstr();
 
 <qstring>["]                BEGIN(INITIAL); endstr(); return (STRING);