From bc2c4c848b14bbdf32ec966595ec3e2bc7def386 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 3 Feb 2013 20:21:04 +0000 Subject: Don't ignore realpath() return value. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5042 a436a847-0d15-0410-975c-d299462d15a1 --- src/binary_location.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/binary_location.h b/src/binary_location.h index 6efa37f..e238467 100644 --- a/src/binary_location.h +++ b/src/binary_location.h @@ -34,7 +34,9 @@ binary_location() const int ret = dladdr((void*)&binary_location, &dli); if (ret) { char* const bin_loc = (char*)calloc(PATH_MAX, 1); - realpath(dli.dli_fname, bin_loc); + if (!realpath(dli.dli_fname, bin_loc)) { + return NULL; + } return bin_loc; } return NULL; -- cgit v1.2.1