bugfix [#20674] SegFault from console 'c = data.texts["text1"].copy()'
This commit is contained in:
@@ -431,8 +431,14 @@ Text *copy_text(Text *ta)
|
|||||||
|
|
||||||
tan= copy_libblock(ta);
|
tan= copy_libblock(ta);
|
||||||
|
|
||||||
tan->name= MEM_mallocN(strlen(ta->name)+1, "text_name");
|
/* file name can be NULL */
|
||||||
strcpy(tan->name, ta->name);
|
if(ta->name) {
|
||||||
|
tan->name= MEM_mallocN(strlen(ta->name)+1, "text_name");
|
||||||
|
strcpy(tan->name, ta->name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tan->name= NULL;
|
||||||
|
}
|
||||||
|
|
||||||
tan->flags = ta->flags | TXT_ISDIRTY;
|
tan->flags = ta->flags | TXT_ISDIRTY;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user