From bbab5b009372eef9ac7855cf41aa1334046ae146 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 2 Sep 2016 15:29:52 +0200 Subject: [PATCH] Hd-rum-translator: fixed small leak --- src/hd-rum-translator/hd-rum-translator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hd-rum-translator/hd-rum-translator.cpp b/src/hd-rum-translator/hd-rum-translator.cpp index 3bf132064..c93b619ff 100644 --- a/src/hd-rum-translator/hd-rum-translator.cpp +++ b/src/hd-rum-translator/hd-rum-translator.cpp @@ -464,7 +464,7 @@ struct host_opts { struct cmdline_parameters { const char *bufsize; unsigned short port; - struct host_opts *hosts; + vector hosts; int host_count; int control_port = CONTROL_DEFAULT_PORT; int control_connection_type = 0; @@ -543,7 +543,7 @@ static bool parse_fmt(int argc, char **argv, struct cmdline_parameters *parsed) } } - parsed->hosts = (struct host_opts *) calloc(parsed->host_count, sizeof(struct host_opts)); + parsed->hosts.resize(parsed->host_count); // default values for(int i = 0; i < parsed->host_count; ++i) { parsed->hosts[i].bitrate = RATE_UNLIMITED;