diff options
-rw-r--r-- | src/stdlib/relpath.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stdlib/relpath.c b/src/stdlib/relpath.c index 92888fa..e3d7e24 100644 --- a/src/stdlib/relpath.c +++ b/src/stdlib/relpath.c @@ -56,6 +56,8 @@ char* relpath(const char* file, const char* ref) /* XXX may also fail as get_cur { p = strlen(cwd); absref = malloc((p + 1) + sizeof(char)); + if (absref == NULL) + goto fail; memcpy(absref, cwd, p); absref[p] = '/'; absref[p + 1] = '\0'; |