From 4f1e213f727c16dd715d0d75ca7746e4a75ba672 Mon Sep 17 00:00:00 2001 From: jbasney Date: Wed, 18 Aug 2004 21:20:09 +0000 Subject: [PATCH] be sure not to call xfree(NULL) --- openssh/auth2-gss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openssh/auth2-gss.c b/openssh/auth2-gss.c index 917cec7..a238e6d 100644 --- a/openssh/auth2-gss.c +++ b/openssh/auth2-gss.c @@ -234,11 +234,11 @@ input_gssapi_errtok(int type, u_int32_t plen, void *ctxt) static void gssapi_set_implicit_username(Authctxt *authctxt) { - if ((authctxt->user == NULL) || (strcmp(authctxt->user, "") == 0)) { + if ((authctxt->user == NULL) || (authctxt->user[0] == '\0')) { char *lname = NULL; PRIVSEP(ssh_gssapi_localname(&lname)); if (lname && lname[0] != '\0') { - xfree(authctxt->user); + if (authctxt->user) xfree(authctxt->user); authctxt->user = lname; debug("set username to %s from gssapi context", lname); authctxt->pw = PRIVSEP(getpwnamallow(authctxt->user)); -- 2.45.2