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.

Submitted by:	peter@ifm.liu.se
MFC after:	2 weeks
This commit is contained in:
rmacklem 2019-04-04 01:23:06 +00:00
parent 33133b3b41
commit e349a3602c

View File

@ -764,7 +764,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);