Use duplicatestring()
instead of strdup()
This commit is contained in:
parent
3a9cfd8e46
commit
dc789353fd
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user