Skip to content

Commit

Permalink
Merge branch 'utoni-fix/cppcheck-complains'
Browse files Browse the repository at this point in the history
  • Loading branch information
yrutschle committed Aug 31, 2023
2 parents 54fe4b2 + e941e8d commit ff9328f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion log.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void print_message(msg_info info, const char* str, ...)
{
va_list ap;


if ((*info.verbose & MSG_STDOUT) && ! cfg.inetd) {
va_start(ap, str);
vfprintf(stderr, str, ap);
Expand Down
8 changes: 6 additions & 2 deletions systemd-sslh-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ static int get_listen_from_conf(const char *filename, char **listen[]) {
config_setting_source_line(addr));
return -1;
} else {
(*listen)[i] = malloc(strlen(resolve_listen(hostname, port)));
char *resolved_listen = resolve_listen(hostname, port);

(*listen)[i] = malloc(strlen(resolved_listen));
CHECK_ALLOC((*listen)[i], "malloc");
strcpy((*listen)[i], resolve_listen(hostname, port));
strcpy((*listen)[i], resolved_listen);
free(resolved_listen);
}
}
}
Expand Down Expand Up @@ -125,6 +128,7 @@ static int gen_sslh_config(char *runtime_unit_dir) {
strcpy(runtime_conf, runtime_unit_dir);
strcat(runtime_conf, unit_file);
runtime_conf_fd = fopen(runtime_conf, "w");
free(runtime_conf);
}


Expand Down
1 change: 1 addition & 0 deletions tcp-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static void tcp_protocol_list_init(void)
if (!p->is_udp) {
tcp_protocols_len++;
tcp_protocols = realloc(tcp_protocols, tcp_protocols_len * sizeof(*tcp_protocols));
CHECK_ALLOC(tcp_protocols, "realloc");
tcp_protocols[tcp_protocols_len-1] = p;
}
}
Expand Down
1 change: 1 addition & 0 deletions udp-listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static void udp_protocol_list_init(void)
if (p->is_udp) {
udp_protocols_len++;
udp_protocols = realloc(udp_protocols, udp_protocols_len * sizeof(*udp_protocols));
CHECK_ALLOC(udp_protocols, "realloc");
udp_protocols[udp_protocols_len-1] = p;
}
}
Expand Down

0 comments on commit ff9328f

Please sign in to comment.