Fix a incorrect size for malloc.
This commit is contained in:
parent
4bc83ac393
commit
14bb8302c4
1 changed files with 1 additions and 1 deletions
2
libtcc.c
2
libtcc.c
|
|
@ -330,7 +330,7 @@ ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh
|
|||
{
|
||||
Section *sec;
|
||||
|
||||
sec = tcc_mallocz(sizeof(Section) + strlen(name));
|
||||
sec = tcc_mallocz(sizeof(Section) + strlen(name)+1);
|
||||
strcpy(sec->name, name);
|
||||
sec->sh_type = sh_type;
|
||||
sec->sh_flags = sh_flags;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue