From bbecbc321150c8b1f2bf43149cea0708958c9b09 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 19 Nov 2015 19:07:55 +0100 Subject: fix issue #2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/stdlib/relpath.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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'; -- cgit v1.2.3-70-g09d2