main: Don’t leak desired_ip memory
Signed-off-by: Anders Kaseorg <andersk@mit.edu> Closes #385.
This commit is contained in:
committed by
Keith Winstein
parent
b9763b6997
commit
ba8d013609
@@ -160,8 +160,9 @@ int main( int argc, char *argv[] )
|
|||||||
/* Detect edge case */
|
/* Detect edge case */
|
||||||
fatal_assert( argc > 0 );
|
fatal_assert( argc > 0 );
|
||||||
|
|
||||||
char *desired_ip = NULL;
|
const char *desired_ip = NULL;
|
||||||
char *desired_port = NULL;
|
string desired_ip_str;
|
||||||
|
const char *desired_port = NULL;
|
||||||
string command_path;
|
string command_path;
|
||||||
char **command_argv = NULL;
|
char **command_argv = NULL;
|
||||||
int colors = 0;
|
int colors = 0;
|
||||||
@@ -194,7 +195,8 @@ int main( int argc, char *argv[] )
|
|||||||
desired_port = optarg;
|
desired_port = optarg;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
desired_ip = strdup( get_SSH_IP().c_str() );
|
desired_ip_str = get_SSH_IP();
|
||||||
|
desired_ip = desired_ip_str.c_str();
|
||||||
fatal_assert( desired_ip );
|
fatal_assert( desired_ip );
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
|
|||||||
Reference in New Issue
Block a user