From 8a7d1c27d1bd31c3730df964dec8a9dd7dceff0e Mon Sep 17 00:00:00 2001 From: rmacklem Date: Thu, 18 Apr 2019 02:54:07 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.freebsd.org/base/stable/10@346344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index 7cd105801..152a0abd8 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -738,7 +738,7 @@ gss_oid_to_str(OM_uint32 *minor_status, gss_OID oid, gss_buffer_t oid_str) * 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); -- 2.45.0