SCP: Fix Coverity identified issues

This commit is contained in:
Mark Pizzolato 2018-07-17 22:05:05 -07:00
parent c5453ff6ed
commit 15fd71b97c

3
scp.c
View file

@ -3679,7 +3679,7 @@ char *tstr = (char *)malloc (1 + rbuf_len);
strcpy (tstr, rbuf); strcpy (tstr, rbuf);
if (*ops == '~') { /* Substring? */ if (*ops == '~') { /* Substring? */
int offset, length = rbuf_len; int offset = 0, length = rbuf_len;
int o, l; int o, l;
switch (sscanf (ops + 1, "%d,%d", &o, &l)) { switch (sscanf (ops + 1, "%d,%d", &o, &l)) {
@ -3741,6 +3741,7 @@ else {
rbuf += move_size; rbuf += move_size;
if (rbuf_size) if (rbuf_size)
*rbuf = '\0'; *rbuf = '\0';
free (match);
} }
} }
free (tstr); free (tstr);