Plug mem leak of msg when processing a quit message.
authordtucker <dtucker@openbsd.org>
Fri, 24 Nov 2023 00:31:30 +0000 (00:31 +0000)
committerdtucker <dtucker@openbsd.org>
Fri, 24 Nov 2023 00:31:30 +0000 (00:31 +0000)
Coverity CID#427852, ok djm@

usr.bin/ssh/clientloop.c

index ffa0fac..6fa70cb 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.401 2023/11/15 22:51:49 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.402 2023/11/24 00:31:30 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -202,6 +202,7 @@ quit_message(const char *fmt, ...)
 
        if ((r = sshbuf_putf(stderr_buffer, "%s\r\n", msg)) != 0)
                fatal_fr(r, "sshbuf_putf");
+       free(msg);
        quit_pending = 1;
 }