From 954234f0a477636eab751a6601d34bab1db41b0e Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 14 Dec 2023 08:00:00 +0000 Subject: treewide: assume free(NULL) is no-op The C standard guarantees that if the argument of free() is a null pointer, no action occurs. --- doc/specs/parse_y.y | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/specs/parse_y.y b/doc/specs/parse_y.y index b195f5d3..96809cd2 100644 --- a/doc/specs/parse_y.y +++ b/doc/specs/parse_y.y @@ -282,9 +282,7 @@ char *new_counter(const char *key) counter_root = set_key(counter_root, key, new); - if (last_label) { - free(last_label); - } + free(last_label); last_label = strdup(new); return new; -- cgit v1.2.3