ITS#9912 slapd: urls comes from optarg, not allocated

May leak on Windows if set in registry. Don't care.
This commit is contained in:
Howard Chu 2022-09-02 04:01:46 +01:00
parent 60518dbae0
commit a6fa0450f6

View file

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