14 lines
575 B
Diff
14 lines
575 B
Diff
|
diff --git a/src/basedir.c b/src/basedir.c
|
||
|
index 68ab879..1a2a8c4 100644
|
||
|
--- a/src/basedir.c
|
||
|
+++ b/src/basedir.c
|
||
|
@@ -574,7 +574,7 @@ static char * xdgGetRelativeHome(const char *envname, const char *relativefallba
|
||
|
unsigned int homelen;
|
||
|
if (!(home = xdgGetEnv("HOME")))
|
||
|
return NULL;
|
||
|
- if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength))) return NULL;
|
||
|
+ if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength+1))) return NULL;
|
||
|
memcpy(relhome, home, homelen);
|
||
|
memcpy(relhome+homelen, relativefallback, fallbacklength+1);
|
||
|
}
|