comparison cli-runopts.c @ 410:b895f91c2ee6

merge of 'b1dd3b94e60a07a176dba2b035ac79968595990a' and 'bcb33fce2fad01a7626598209d43af3571bd86f0'
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Feb 2007 10:32:59 +0000
parents 9341570412e5 ea0929224294
children 47bcc3536bd5
comparison
equal deleted inserted replaced
399:a707e6148060 410:b895f91c2ee6
371 connectaddr = strchr(str, ':'); 371 connectaddr = strchr(str, ':');
372 if (connectaddr == NULL) { 372 if (connectaddr == NULL) {
373 TRACE(("connectaddr == NULL")) 373 TRACE(("connectaddr == NULL"))
374 goto fail; 374 goto fail;
375 } 375 }
376 376 *connectaddr = '\0';
377 connectaddr[0] = '\0';
378 connectaddr++; 377 connectaddr++;
379 378
380 connectport = strchr(connectaddr, ':'); 379 connectport = strchr(connectaddr, ':');
381 if (connectport == NULL) { 380 if (connectport == NULL) {
382 TRACE(("connectport == NULL")) 381 TRACE(("connectport == NULL"))
383 goto fail; 382 goto fail;
384 } 383 }
385 384 *connectport = '\0';
386 connectport[0] = '\0';
387 connectport++; 385 connectport++;
388 386
389 newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList)); 387 newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList));
390 388
391 /* Now we check the ports - note that the port ints are unsigned, 389 /* Now we check the ports - note that the port ints are unsigned,
415 } 413 }
416 414
417 newfwd->next = *fwdlist; 415 newfwd->next = *fwdlist;
418 *fwdlist = newfwd; 416 *fwdlist = newfwd;
419 417
418 m_free(str);
419
420 TRACE(("leave addforward: done")) 420 TRACE(("leave addforward: done"))
421 return; 421 return;
422 422
423 fail: 423 fail:
424 dropbear_exit("Bad TCP forward '%s'", origstr); 424 dropbear_exit("Bad TCP forward '%s'", origstr);