From 4b0eaf5c1757a546db77c8984dfb172191a43d82 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 10 Feb 2022 11:10:40 +0000 Subject: [PATCH] Free conn->last_modified before overwriting it with strdup(). If it was set, this would leak 30 bytes. ok claudio --- usr.sbin/rpki-client/http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c index 117c706885c..e04af6afc70 100644 --- a/usr.sbin/rpki-client/http.c +++ b/usr.sbin/rpki-client/http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http.c,v 1.52 2022/01/23 12:09:24 claudio Exp $ */ +/* $OpenBSD: http.c,v 1.53 2022/02/10 11:10:40 tb Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2020 Claudio Jeker @@ -1231,6 +1231,7 @@ http_parse_header(struct http_connection *conn, char *buf) } else if (strncasecmp(cp, LAST_MODIFIED, sizeof(LAST_MODIFIED) - 1) == 0) { cp += sizeof(LAST_MODIFIED) - 1; + free(conn->last_modified); if ((conn->last_modified = strdup(cp)) == NULL) err(1, NULL); } -- 2.20.1