Skip to content

Commit

Permalink
main: Don’t leak desired_ip memory
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Closes #385.
  • Loading branch information
andersk authored and keithw committed Mar 10, 2013
1 parent b9763b6 commit ba8d013
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/frontend/mosh-server.cc
Expand Up @@ -160,8 +160,9 @@ int main( int argc, char *argv[] )
/* Detect edge case */
fatal_assert( argc > 0 );

char *desired_ip = NULL;
char *desired_port = NULL;
const char *desired_ip = NULL;
string desired_ip_str;
const char *desired_port = NULL;
string command_path;
char **command_argv = NULL;
int colors = 0;
Expand Down Expand Up @@ -194,7 +195,8 @@ int main( int argc, char *argv[] )
desired_port = optarg;
break;
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 );
break;
case 'c':
Expand Down

0 comments on commit ba8d013

Please sign in to comment.