From bd8fdda0339c3040da7c0ceee07446aeef159780 Mon Sep 17 00:00:00 2001 From: tobhe Date: Sat, 20 Nov 2021 20:44:33 +0000 Subject: [PATCH] Fix some strdup() leaks in ocsp config option. ok markus@ --- sbin/iked/parse.y | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index 6267acbefc5..eb99b0a7dd8 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.136 2021/11/16 21:43:36 tobhe Exp $ */ +/* $OpenBSD: parse.y,v 1.137 2021/11/20 20:44:33 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -514,23 +514,14 @@ set : SET ACTIVE { passive = 0; } | SET STICKYADDRESS { stickyaddress = 1; } | SET NOSTICKYADDRESS { stickyaddress = 0; } | SET OCSP STRING { - if ((ocsp_url = strdup($3)) == NULL) { - yyerror("cannot set ocsp_url"); - YYERROR; - } + ocsp_url = $3; } | SET OCSP STRING TOLERATE time_spec { - if ((ocsp_url = strdup($3)) == NULL) { - yyerror("cannot set ocsp_url"); - YYERROR; - } + ocsp_url = $3; ocsp_tolerate = $5; } | SET OCSP STRING TOLERATE time_spec MAXAGE time_spec { - if ((ocsp_url = strdup($3)) == NULL) { - yyerror("cannot set ocsp_url"); - YYERROR; - } + ocsp_url = $3; ocsp_tolerate = $5; ocsp_maxage = $7; } -- 2.20.1