comparison cli-runopts.c @ 411:253958302381

Revert bogus fix, make a note that the var is meant to 'leak'
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Feb 2007 10:44:07 +0000
parents ea0929224294
children 47bcc3536bd5
comparison
equal deleted inserted replaced
407:ea0929224294 411:253958302381
346 struct TCPFwdList* newfwd = NULL; 346 struct TCPFwdList* newfwd = NULL;
347 char * str = NULL; 347 char * str = NULL;
348 348
349 TRACE(("enter addforward")) 349 TRACE(("enter addforward"))
350 350
351 /* We probably don't want to be editing argvs */ 351 /* We need to split the original argument up. This var
352 is never free()d. */
352 str = m_strdup(origstr); 353 str = m_strdup(origstr);
353 354
354 listenport = str; 355 listenport = str;
355 356
356 connectaddr = strchr(str, ':'); 357 connectaddr = strchr(str, ':');
398 } 399 }
399 400
400 newfwd->next = *fwdlist; 401 newfwd->next = *fwdlist;
401 *fwdlist = newfwd; 402 *fwdlist = newfwd;
402 403
403 m_free(str);
404
405 TRACE(("leave addforward: done")) 404 TRACE(("leave addforward: done"))
406 return; 405 return;
407 406
408 fail: 407 fail:
409 dropbear_exit("Bad TCP forward '%s'", origstr); 408 dropbear_exit("Bad TCP forward '%s'", origstr);