diff options
Diffstat (limited to 'other/bootstrap_daemon/tox-bootstrapd.c')
-rw-r--r-- | other/bootstrap_daemon/tox-bootstrapd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/other/bootstrap_daemon/tox-bootstrapd.c b/other/bootstrap_daemon/tox-bootstrapd.c index 0848cd17..a0f93bb3 100644 --- a/other/bootstrap_daemon/tox-bootstrapd.c +++ b/other/bootstrap_daemon/tox-bootstrapd.c | |||
@@ -210,7 +210,9 @@ void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int | |||
210 | } | 210 | } |
211 | 211 | ||
212 | // the loop above skips invalid ports, so we adjust the allocated memory size | 212 | // the loop above skips invalid ports, so we adjust the allocated memory size |
213 | *tcp_relay_ports = realloc(*tcp_relay_ports, (*tcp_relay_port_count) * sizeof(uint16_t)); | 213 | if ((*tcp_relay_port_count) * sizeof(uint16_t) > 0) { |
214 | *tcp_relay_ports = realloc(*tcp_relay_ports, (*tcp_relay_port_count) * sizeof(uint16_t)); | ||
215 | } | ||
214 | } | 216 | } |
215 | 217 | ||
216 | // Gets general config options | 218 | // Gets general config options |