diff --git a/scp.c b/scp.c index 553b18b7..25010776 100644 --- a/scp.c +++ b/scp.c @@ -3679,7 +3679,7 @@ char *tstr = (char *)malloc (1 + rbuf_len); strcpy (tstr, rbuf); if (*ops == '~') { /* Substring? */ - int offset, length = rbuf_len; + int offset = 0, length = rbuf_len; int o, l; switch (sscanf (ops + 1, "%d,%d", &o, &l)) { @@ -3741,6 +3741,7 @@ else { rbuf += move_size; if (rbuf_size) *rbuf = '\0'; + free (match); } } free (tstr);