From f01e4edfc85f0d147a3462247f053aefcbb6552c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 31 Aug 2023 22:15:54 +0200 Subject: [PATCH] libipf: fix parser error message. MFC after: 1 week Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D41652 (cherry picked from commit 4cd9d804ae8b955d47dfa0bba06e7c254d760cb1) --- sbin/ipf/libipf/parseipfexpr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sbin/ipf/libipf/parseipfexpr.c b/sbin/ipf/libipf/parseipfexpr.c index 215e43b2978d..880258e5dd66 100644 --- a/sbin/ipf/libipf/parseipfexpr.c +++ b/sbin/ipf/libipf/parseipfexpr.c @@ -93,11 +93,7 @@ parseipfexpr(char *line, char **errorptr) break; } if (e->ipoe_word == NULL) { - error = malloc(32); - if (error != NULL) { - snprintf(error, sizeof(error), "keyword (%.10s) not found", - ops); - } + asprintf(&error, "keyword (%.10s) not found", ops); goto parseerror; }