]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1324: Memory leak in 'msgparse.c' in
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Sep 2025 15:10:42 +0000 (17:10 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Sep 2025 15:10:42 +0000 (17:10 +0200)
  'parse_edns_options_from_query(...)'.

doc/Changelog
util/configparser.y

index d7e1a0ddc91ad3dc3104ce0ee4009b29f647a09c..77c4b554fa1789acb27dd429f3af355869a3221a 100644 (file)
@@ -1,6 +1,8 @@
 2 September 2025: Wouter
        - Fix #1235: Outdated Python2 code in
          unbound/pythonmod/examples/log.py.
+       - Fix #1324: Memory leak in 'msgparse.c' in
+         'parse_edns_options_from_query(...)'.
 
 1 September 2025: Wouter
        - Fix for #1324: Fix to free edns options scratch in ratelimit case.
index ebb23f41cbd359044c4f94f7cc91389a2fb81f53..ba754b3e5099d058ab4a77d96fb69c38e420d00a 100644 (file)
@@ -1168,11 +1168,13 @@ server_http_endpoint: VAR_HTTP_ENDPOINT STRING_ARG
                free(cfg_parser->cfg->http_endpoint);
                if($2 && $2[0] != '/') {
                        cfg_parser->cfg->http_endpoint = malloc(strlen($2)+2);
-                       if(!cfg_parser->cfg->http_endpoint)
+                       if(cfg_parser->cfg->http_endpoint) {
+                               cfg_parser->cfg->http_endpoint[0] = '/';
+                               memmove(cfg_parser->cfg->http_endpoint+1, $2,
+                                       strlen($2)+1);
+                       } else {
                                yyerror("out of memory");
-                       cfg_parser->cfg->http_endpoint[0] = '/';
-                       memmove(cfg_parser->cfg->http_endpoint+1, $2,
-                               strlen($2)+1);
+                       }
                        free($2);
                } else {
                        cfg_parser->cfg->http_endpoint = $2;