Skip to content

Commit a373715

Browse files
committed
Merge branch 'master' of https://github.com/wifidog/wifidog-gateway into travis-clang
Conflicts: src/conf.c
2 parents f02b6ff + 5fae154 commit a373715

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/conf.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ parse_auth_server(FILE *file, const char *filename, int *linenum)
301301

302302
switch (opcode) {
303303
case oAuthServHostname:
304+
/* Coverity rightfully pointed out we could have duplicates here. */
305+
if (NULL != host)
306+
free(host);
304307
host = safe_strdup(p2);
305308
break;
306309
case oAuthServPath:
@@ -351,8 +354,15 @@ parse_auth_server(FILE *file, const char *filename, int *linenum)
351354
}
352355

353356
/* only proceed if we have an host and a path */
354-
if (host == NULL)
357+
if (host == NULL) {
358+
free(path);
359+
free(authscriptpathfragment);
360+
free(pingscriptpathfragment);
361+
free(msgscriptpathfragment);
362+
free(portalscriptpathfragment);
363+
free(loginscriptpathfragment);
355364
return;
365+
}
356366

357367
debug(LOG_DEBUG, "Adding %s:%d (SSL: %d) %s to the auth server list",
358368
host, http_port, ssl_port, path);
@@ -850,6 +860,8 @@ void parse_trusted_mac_list(const char *ptr) {
850860
/* check for valid format */
851861
if (!check_mac_format(possiblemac)) {
852862
debug(LOG_ERR, "[%s] not a valid MAC address to trust. See option TrustedMACList in wifidog.conf for correct this mistake.", possiblemac);
863+
free(ptrcopy);
864+
free(mac);
853865
return;
854866
} else {
855867
if (sscanf(possiblemac, " %17[A-Fa-f0-9:]", mac) == 1) {

0 commit comments

Comments
 (0)