X-Git-Url: https://ruderich.org/simon/gitweb/?p=tlsproxy%2Ftlsproxy.git;a=blobdiff_plain;f=src%2Ftlsproxy.c;h=a35b49b0280d99e52f8cb8db2f5ec88110bb0d85;hp=fa570641b264f87e738f81862f03439bac05b388;hb=HEAD;hpb=730ce301477d9d5c9367756bad840eb4504e0257 diff --git a/src/tlsproxy.c b/src/tlsproxy.c index fa57064..a35b49b 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -3,7 +3,7 @@ * ensures the server certificate doesn't change. Normally this isn't detected * if a trusted CA for the new server certificate is installed. * - * Copyright (C) 2011-2013 Simon Ruderich + * Copyright (C) 2011-2014 Simon Ruderich * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -317,12 +317,11 @@ static void parse_arguments(int argc, char **argv) { memcpy(global_proxy_host, optarg, (size_t)(position - optarg)); global_proxy_host[position - optarg] = '\0'; - global_proxy_port = malloc(strlen(position + 1) + 1); + global_proxy_host = strdup(position + 1); if (global_proxy_port == NULL) { - perror("malloc()"); + perror("strdup()"); exit(EXIT_FAILURE); } - strcpy(global_proxy_port, position + 1); break; }