1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-17 19:40:18 +02:00

eeshow/sch-parse.c (parse_field): fix small memory leak

This commit is contained in:
Werner Almesberger 2016-08-14 10:21:11 -03:00
parent 092386d0c2
commit 57dbe2344c

View File

@ -102,6 +102,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
field = alloc_type(struct comp_field);
txt = &field->txt;
txt->s = NULL;
if (sscanf(line, "F %d \"\" %c %d %d %u %u %c %c%c%c",
&n, &hv, &txt->x, &txt->y, &txt->size, &flags, &hor, &vert,
@ -115,6 +116,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
return 0;
if (flags || (comp->comp && !lib_field_visible(comp->comp, n))) {
free((char *) txt->s);
free(field);
return 1;
}