Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-09-10 15:14:29 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-09-10 15:14:29 +0400
commit20d6b792a49fe0693e6ebfb05bbec3ce4d2b3930 (patch)
tree23155c7073f366f96b1d90bd467d550ce31f4065 /source/blender/editors/space_console
parent965205d0e2c08aa005de0451dfda7380b9bc6221 (diff)
Fix T41767: Memory free problem when console area copy fail.
Nice little memleak! Patch by reporter (randon (Dun Liang)) with minor own cleanup, thanks!
Diffstat (limited to 'source/blender/editors/space_console')
-rw-r--r--source/blender/editors/space_console/console_ops.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index b8743d69762..b44e942527c 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -888,7 +888,7 @@ static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceConsole *sc = CTX_wm_space_console(C);
- DynStr *buf_dyn = BLI_dynstr_new();
+ DynStr *buf_dyn;
char *buf_str;
ConsoleLine *cl;
@@ -897,14 +897,6 @@ static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
ConsoleLine cl_dummy = {NULL};
-#if 0
- /* copy whole file */
- for (cl = sc->scrollback.first; cl; cl = cl->next) {
- BLI_dynstr_append(buf_dyn, cl->line);
- BLI_dynstr_append(buf_dyn, "\n");
- }
-#endif
-
if (sc->sel_start == sc->sel_end)
return OPERATOR_CANCELLED;
@@ -919,6 +911,7 @@ static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
}
+ buf_dyn = BLI_dynstr_new();
offset -= 1;
sel[0] = offset - sc->sel_end;
sel[1] = offset - sc->sel_start;