From: Jeff Moyer Subject: [patch] don't pass a null pointer to pthread_attr_destroy Date: Fri, 04 Sep 2009 12:25:22 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autofs-bounces@linux.kernel.org Errors-To: autofs-bounces@linux.kernel.org To: ikent@redhat.com Cc: autofs@linux.kernel.org Hi, Ian, pthread_attr_destroy will dereference the pointer that is passed in. Since we can get here with a NULL pattrs, we better check for that. Cheers, Jeff Signed-off-by: Jeff Moyer diff --git a/daemon/state.c b/daemon/state.c index 71af46a..2eeb4bf 100644 --- a/daemon/state.c +++ b/daemon/state.c @@ -1198,7 +1198,8 @@ int st_start_handler(void) status = pthread_create(&thid, pattrs, st_queue_handler, NULL); - pthread_attr_destroy(pattrs); + if (pattrs) + pthread_attr_destroy(pattrs); return !status; }