From 94f23a6856f0cf2157596129eeda65dff7820446 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 21 Jun 2010 21:26:25 -0700 Subject: [PATCH] Ensure NULL is not returned incorrectly after the first call. I'm surprised this was not caught long ago, but previous the code actually never did call the function twice so it was missed. Anyway, this fixes it. --- lib/libspl/getexecname.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libspl/getexecname.c b/lib/libspl/getexecname.c index 43bf39ae33..c564eed055 100644 --- a/lib/libspl/getexecname.c +++ b/lib/libspl/getexecname.c @@ -48,6 +48,8 @@ getexecname(void) execname[rc] = '\0'; ptr = execname; } + } else { + ptr = execname; } pthread_mutex_unlock(&mtx);