]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9912 slapd: urls comes from optarg, not allocated
authorHoward Chu <hyc@openldap.org>
Fri, 2 Sep 2022 03:01:46 +0000 (04:01 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 12 Sep 2022 20:45:04 +0000 (20:45 +0000)
May leak on Windows if set in registry. Don't care.

servers/slapd/main.c

index a9e69b01a11cb6e0cd51955cbc68cf2c6d5dd591..a02d6635136d500082b0ee8a12701f1c8ee7f01f 100644 (file)
@@ -316,9 +316,6 @@ int main( int argc, char **argv )
 
                newUrls = (char *) lutil_getRegParam(regService, "Urls");
                if (newUrls) {
-                   if (urls)
-                       ch_free(urls);
-
                    urls = ch_strdup(newUrls);
                    Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n",
                                urls );
@@ -367,7 +364,6 @@ int main( int argc, char **argv )
 #endif
 
                case 'h':       /* listen URLs */
-                       if ( urls != NULL ) free( urls );
                        urls = optarg;
                        break;