mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 22:57:30 +02:00
eeshow/lib-parse.c (parse_def): don't break free'ing the component name
This commit is contained in:
parent
9c988e2d7e
commit
3b8b8a20d2
@ -69,8 +69,14 @@ static bool parse_def(struct lib *lib, const char *line)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
lib->curr_comp = alloc_type(struct comp);
|
lib->curr_comp = alloc_type(struct comp);
|
||||||
if (*s == '~')
|
if (*s == '~') {
|
||||||
s++;
|
char *tmp = alloc_size(strlen(s) + 1);
|
||||||
|
|
||||||
|
/* we can't just s++, since that would break freeing */
|
||||||
|
strcpy(tmp, s + 1);
|
||||||
|
free(s);
|
||||||
|
s = tmp;
|
||||||
|
}
|
||||||
lib->curr_comp->name = s;
|
lib->curr_comp->name = s;
|
||||||
lib->curr_comp->units = units;
|
lib->curr_comp->units = units;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user