From: Michael R Sweet Date: Wed, 14 Aug 2024 00:31:48 +0000 (-0400) Subject: Make sure we duplicate strings returned by cgiGetTextField, just as we do for cgiGetV... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34819b710cba4fe0de4dfd020f4cff0e8c43a52a;p=thirdparty%2Fcups.git Make sure we duplicate strings returned by cgiGetTextField, just as we do for cgiGetVariable (Issue #999) --- diff --git a/cgi-bin/var.c b/cgi-bin/var.c index e97d2a8fca..fdc6fa7b57 100644 --- a/cgi-bin/var.c +++ b/cgi-bin/var.c @@ -288,7 +288,7 @@ cgiGetTextfield(const char *name) /* I - Name of form field */ value = NULL; } - return (value); + return (value ? strdup(value) : NULL); }