summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/binary_location.h4
1 files changed, 3 insertions, 1 deletions
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;