mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-01 03:03:58 +00:00
Don't access free memory after unloading a module. Bugzilla #4168.
This commit is contained in:
parent
79dc689261
commit
a715634d23
3 changed files with 25 additions and 1 deletions
|
|
@ -94,3 +94,19 @@ Xstrdup(const char *s)
|
|||
strcpy(sd, s);
|
||||
return sd;
|
||||
}
|
||||
|
||||
char *
|
||||
XNFstrdup(const char *s)
|
||||
{
|
||||
char *sd;
|
||||
size_t len;
|
||||
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
|
||||
len = strlen(s) + 1;
|
||||
sd = (char *)XNFalloc(len);
|
||||
strlcpy(sd, s, len);
|
||||
return sd;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue