-
Michal Privoznik authored
The connect_socket() can be called with @server argument being set to a hostname that's different to "localhost" but in fact is localhost. In this case, and when @allow_server_override is set, the function connects to "localhost". Well, the leak exists because in aforementioned case the @server variable is overwritten. And since it is plain 'char *' it has to be strdup()-ed. But switching it to 'const char *', it can be set to "localhost" literal. Similarly, @port is constant and unchanged withing the function and thus should be type of 'const char *'. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>