mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-14 07:19:31 -06:00
textdup is now safe in case of memory overflow
This commit is contained in:
@@ -21,7 +21,8 @@ PgfText* textdup(PgfText *t1)
|
||||
{
|
||||
size_t size = sizeof(PgfText)+t1->size+1;
|
||||
PgfText *t2 = (PgfText *) malloc(size);
|
||||
memcpy(t2, t1, size);
|
||||
if (t2 != NULL)
|
||||
memcpy(t2, t1, size);
|
||||
return t2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user