Skip to content

Commit 1a15c36

Browse files
committed
Fix memory leaks in conf.c
1 parent 3a1a6b3 commit 1a15c36

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/conf.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,21 @@ parse_auth_server(FILE *file, const char *filename, int *linenum)
348348
}
349349

350350
/* only proceed if we have an host and a path */
351-
if (host == NULL)
351+
if (host == NULL) {
352+
if (NULL != path)
353+
free(path);
354+
if (NULL != authscriptpathfragment)
355+
free(authscriptpathfragment);
356+
if (NULL != pingscriptpathfragment)
357+
free(pingscriptpathfragment);
358+
if (NULL != msgscriptpathfragment)
359+
free(msgscriptpathfragment);
360+
if (NULL != portalscriptpathfragment)
361+
free(portalscriptpathfragment);
362+
if (NULL != loginscriptpathfragment)
363+
free(loginscriptpathfragment);
352364
return;
365+
}
353366

354367
debug(LOG_DEBUG, "Adding %s:%d (SSL: %d) %s to the auth server list",
355368
host, http_port, ssl_port, path);

0 commit comments

Comments
 (0)