svn commit: r281857 - head/lib/libthr/thread

Pedro F. Giffuni pfg at FreeBSD.org
Wed Apr 22 16:51:22 UTC 2015


Author: pfg
Date: Wed Apr 22 16:51:21 2015
New Revision: 281857
URL: https://svnweb.freebsd.org/changeset/base/281857

Log:
  _pthread_cleanup_push: fix allocator sizeof operand mismatch
  
  Same fix appears to be in DragonFly's libthread_xu.
  
  Found by:	Clang Static Analyzer
  MFC after:	1 week

Modified:
  head/lib/libthr/thread/thr_clean.c

Modified: head/lib/libthr/thread/thr_clean.c
==============================================================================
--- head/lib/libthr/thread/thr_clean.c	Wed Apr 22 16:06:49 2015	(r281856)
+++ head/lib/libthr/thread/thr_clean.c	Wed Apr 22 16:51:21 2015	(r281857)
@@ -84,7 +84,7 @@ _pthread_cleanup_push(void (*routine) (v
 	curthread->unwind_disabled = 1;
 #endif
 	if ((newbuf = (struct pthread_cleanup *)
-	    malloc(sizeof(struct _pthread_cleanup_info))) != NULL) {
+	    malloc(sizeof(struct pthread_cleanup))) != NULL) {
 		newbuf->routine = routine;
 		newbuf->routine_arg = arg;
 		newbuf->onheap = 1;


More information about the svn-src-head mailing list