diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-19 19:07:55 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-19 19:07:55 +0100 |
commit | bbecbc321150c8b1f2bf43149cea0708958c9b09 (patch) | |
tree | c9dd9e19d5ec5bd5415274246765902b457a4fbe /src/stdlib | |
parent | doc (diff) | |
download | slibc-bbecbc321150c8b1f2bf43149cea0708958c9b09.tar.gz slibc-bbecbc321150c8b1f2bf43149cea0708958c9b09.tar.bz2 slibc-bbecbc321150c8b1f2bf43149cea0708958c9b09.tar.xz |
fix issue #2
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/stdlib')
-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'; |