mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Fix a couple of memory leaks, from Tiago Cunha.
This commit is contained in:
parent
6f08472049
commit
538af37c35
@ -60,9 +60,10 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
len = 0;
|
||||
|
||||
n = args_strtonum(args, 'S', SHRT_MIN, SHRT_MAX, &cause);
|
||||
if (cause != NULL)
|
||||
if (cause != NULL) {
|
||||
top = gd->hsize;
|
||||
else if (n < 0 && (u_int) -n > gd->hsize)
|
||||
xfree(cause);
|
||||
} else if (n < 0 && (u_int) -n > gd->hsize)
|
||||
top = 0;
|
||||
else
|
||||
top = gd->hsize + n;
|
||||
@ -70,9 +71,10 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
top = gd->hsize + gd->sy - 1;
|
||||
|
||||
n = args_strtonum(args, 'E', SHRT_MIN, SHRT_MAX, &cause);
|
||||
if (cause != NULL)
|
||||
if (cause != NULL) {
|
||||
bottom = gd->hsize + gd->sy - 1;
|
||||
else if (n < 0 && (u_int) -n > gd->hsize)
|
||||
xfree(cause);
|
||||
} else if (n < 0 && (u_int) -n > gd->hsize)
|
||||
bottom = 0;
|
||||
else
|
||||
bottom = gd->hsize + n;
|
||||
|
Loading…
Reference in New Issue
Block a user