From: atheik Date: Sat, 30 Apr 2022 21:48:26 +0000 (+0300) Subject: cifs-utils: don't return uninitialized value in cifs_gss_get_req X-Git-Tag: cifs-utils-7.0~1 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=7b918730168851586416b22d2197fc6ce7be0638;p=cifs-utils.git cifs-utils: don't return uninitialized value in cifs_gss_get_req If the first malloc fails, maj_stat is uninitialized and used as the return value through the GSS_ERROR() macro. Use GSS_S_FAILURE to indicate a miscellaneous error. Signed-off-by: atheik --- diff --git a/cifs.upcall.c b/cifs.upcall.c index 922d644..52c0328 100644 --- a/cifs.upcall.c +++ b/cifs.upcall.c @@ -795,6 +795,7 @@ cifs_gss_get_req(const char *host, DATA_BLOB *mechtoken, DATA_BLOB *sess_key) char *service_name = malloc(service_name_len); if (!service_name) { syslog(LOG_DEBUG, "out of memory allocating service name"); + maj_stat = GSS_S_FAILURE; goto out; }