From 1a66079c0669813306cc69e5776a4acd9fb49015 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Tue, 31 Jul 2018 03:07:24 +0000 Subject: upstream: fix some memory leaks spotted by Coverity via Jakub Jelen in bz#2366 feedback and ok dtucker@ OpenBSD-Commit-ID: 8402bbae67d578bedbadb0ce68ff7c5a136ef563 --- compat.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'compat.h') diff --git a/compat.h b/compat.h index 28d2c8135..e2877737b 100644 --- a/compat.h +++ b/compat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.h,v 1.52 2018/07/03 11:39:54 djm Exp $ */ +/* $OpenBSD: compat.h,v 1.53 2018/07/31 03:07:24 djm Exp $ */ /* * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. @@ -65,9 +65,15 @@ u_int compat_datafellows(const char *); int proto_spec(const char *); -char *compat_cipher_proposal(char *); -char *compat_pkalg_proposal(char *); -char *compat_kex_proposal(char *); + +/* + * compat_*_proposal will update their respective proposals based on the + * active compat flags. The replacement is performed in-place - i.e. they + * will free their argument and return a new heap-allocated string. + */ +char *compat_cipher_proposal(char *, u_int compat); +char *compat_pkalg_proposal(char *, u_int compat); +char *compat_kex_proposal(char *, u_int compat); extern int datafellows; #endif -- cgit v1.2.3