SCP: Fix Coverity identified issues
This commit is contained in:
parent
c5453ff6ed
commit
15fd71b97c
1 changed files with 2 additions and 1 deletions
3
scp.c
3
scp.c
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue