Use duplicatestring() instead of strdup()

This commit is contained in:
Stanislav Gromov 2020-11-15 02:23:42 +07:00
parent 3a9cfd8e46
commit dc789353fd
2 changed files with 2 additions and 2 deletions

View File

@ -8365,7 +8365,7 @@ static void dopragma(void)
* and parse the argument(s), if needed */
if (!strcmp(str,"deprecated")) {
free(pc_deprecate);
pc_deprecate=strdup(&str[i]);
pc_deprecate=duplicatestring(&str[i]);
if (pc_deprecate==NULL)
error(103); /* insufficient memory */
pc_attributes |= (1U << attrDEPRECATED);

View File

@ -1010,7 +1010,7 @@ static const unsigned char *getstring(unsigned char *dest,int max,const unsigned
*/
static char* strdupwithouta(const char* sourcestring)
{
char* result=strdup(sourcestring);
char* result=duplicatestring(sourcestring);
char* a=result;
if (result==NULL) {
return NULL;