mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-23 01:41:53 +02:00
eeshow/sch-parse.c (parse_field): fix small memory leak
This commit is contained in:
parent
092386d0c2
commit
57dbe2344c
@ -102,6 +102,7 @@ static bool parse_field(struct sch_ctx *ctx, const char *line)
|
|||||||
|
|
||||||
field = alloc_type(struct comp_field);
|
field = alloc_type(struct comp_field);
|
||||||
txt = &field->txt;
|
txt = &field->txt;
|
||||||
|
txt->s = NULL;
|
||||||
|
|
||||||
if (sscanf(line, "F %d \"\" %c %d %d %u %u %c %c%c%c",
|
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,
|
&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;
|
return 0;
|
||||||
|
|
||||||
if (flags || (comp->comp && !lib_field_visible(comp->comp, n))) {
|
if (flags || (comp->comp && !lib_field_visible(comp->comp, n))) {
|
||||||
|
free((char *) txt->s);
|
||||||
free(field);
|
free(field);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user