File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -846,6 +846,8 @@ void parse_trusted_mac_list(const char *ptr) {
846
846
/* check for valid format */
847
847
if (!check_mac_format (possiblemac )) {
848
848
debug (LOG_ERR , "[%s] not a valid MAC address to trust. See option TrustedMACList in wifidog.conf for correct this mistake." , possiblemac );
849
+ free (ptrcopy );
850
+ free (mac );
849
851
return ;
850
852
} else {
851
853
if (sscanf (possiblemac , " %17[A-Fa-f0-9:]" , mac ) == 1 ) {
@@ -860,10 +862,10 @@ void parse_trusted_mac_list(const char *ptr) {
860
862
} else {
861
863
/* Advance to the last entry */
862
864
for (p = config .trustedmaclist ; p -> next != NULL ; p = p -> next );
863
- p -> next = safe_malloc (sizeof (t_trusted_mac ));
864
- p = p -> next ;
865
- p -> mac = safe_strdup (mac );
866
- p -> next = NULL ;
865
+ p -> next = safe_malloc (sizeof (t_trusted_mac ));
866
+ p = p -> next ;
867
+ p -> mac = safe_strdup (mac );
868
+ p -> next = NULL ;
867
869
}
868
870
}
869
871
}
You can’t perform that action at this time.
0 commit comments