Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 2019 02:47:59 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r346343 - stable/11/sys/rpc/rpcsec_gss
Message-ID:  <201904180247.x3I2lxQ7093612@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Thu Apr 18 02:47:59 2019
New Revision: 346343
URL: https://svnweb.freebsd.org/changeset/base/346343

Log:
  MFC: r345866
  Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.
  
  The code enabled when "DEBUG" is defined uses mem_alloc(), which is a
  malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer()
  which does a free(.., M_GSSAPI) to free the memory.
  This patch fixes the problem by replacing mem_alloc() with a
  malloc(.., M_GSSAPI, M_WAITOK | M_ZERO).
  This bug affects almost no one, since the sources are not normally built
  with "DEBUG" defined.

Modified:
  stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Thu Apr 18 02:32:04 2019	(r346342)
+++ stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Thu Apr 18 02:47:59 2019	(r346343)
@@ -755,7 +755,7 @@ gss_oid_to_str(OM_uint32 *minor_status, gss_OID oid, g
 	 * here for "{ " and "}\0".
 	 */
 	string_length += 4;
-	if ((bp = (char *) mem_alloc(string_length))) {
+	if ((bp = malloc(string_length, M_GSSAPI, M_WAITOK | M_ZERO))) {
 		strcpy(bp, "{ ");
 		number = (unsigned long) cp[0];
 		sprintf(numstr, "%ld ", number/40);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904180247.x3I2lxQ7093612>