svn commit: r318588 - head/usr.sbin/nscd

Cy Schubert cy at FreeBSD.org
Sat May 20 18:16:28 UTC 2017


Author: cy
Date: Sat May 20 18:16:26 2017
New Revision: 318588
URL: https://svnweb.freebsd.org/changeset/base/318588

Log:
  Fix up two assertions following malloc(). vangyzen@ notified me of
  the second one. The first one is fixed as well.
  
  Reported by:	vangyzen@
  MFC after:	1 week

Modified:
  head/usr.sbin/nscd/query.c

Modified: head/usr.sbin/nscd/query.c
==============================================================================
--- head/usr.sbin/nscd/query.c	Sat May 20 18:02:31 2017	(r318587)
+++ head/usr.sbin/nscd/query.c	Sat May 20 18:16:26 2017	(r318588)
@@ -725,7 +725,7 @@ on_read_request_process(struct query_sta
 		if (read_response->error_code == -2) {
 			read_response->data = malloc(
 				read_response->data_size);
-			assert(read_response != NULL);
+			assert(read_response->data != NULL);
 			read_response->error_code = cache_read(c_entry,
 				read_request->cache_key,
 		    		read_request->cache_key_size,
@@ -745,7 +745,7 @@ on_read_request_process(struct query_sta
 			if (read_response->error_code == -2) {
 				read_response->data = malloc(
 					read_response->data_size);
-				assert(read_response != NULL);
+				assert(read_response->data != NULL);
 				read_response->error_code = cache_read(neg_c_entry,
 					read_request->cache_key,
 		    			read_request->cache_key_size,


More information about the svn-src-head mailing list