diff --git a/src/ChangeLog b/src/ChangeLog index d2c645f0b..96800eb45 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-12-26 Pavel Roskin + * file.c: Never access internals of ctx->rx directly. + * fileopctx.c (file_op_context_destroy): Use regfree() to free + ctx->rx. + Patch from Red Hat beta. + * layout.c (setup_panels): Clean the hint bar if it's enabled. Bug reported by Adam Byrtek diff --git a/src/file.c b/src/file.c index 738e4c624..4f4f8cb7e 100644 --- a/src/file.c +++ b/src/file.c @@ -1836,7 +1836,6 @@ panel_operate (void *source_panel, FileOperation operation, ctx = file_op_context_new (); do_bg = 0; - ctx->rx.buffer = NULL; free_linklist (&linklist); free_linklist (&dest_dirs); if (get_current_type () == view_listing) @@ -1864,10 +1863,6 @@ panel_operate (void *source_panel, FileOperation operation, return 0; } } else if (operation != OP_DELETE) { - ctx->rx.buffer = (char *) g_malloc (MC_MAXPATHLEN); - ctx->rx.allocated = MC_MAXPATHLEN; - ctx->rx.translate = 0; - if (ask_user) { char *dest_dir; @@ -1882,12 +1877,10 @@ panel_operate (void *source_panel, FileOperation operation, file_mask_dialog (ctx, operation, cmd_buf, dest_dir, only_one, &do_bg); if (!dest) { - g_free (ctx->rx.buffer); file_op_context_destroy (ctx); return 0; } if (!*dest) { - g_free (ctx->rx.buffer); file_op_context_destroy (ctx); g_free (dest); return 0; @@ -2153,11 +2146,6 @@ panel_operate (void *source_panel, FileOperation operation, if (temp) g_free (temp); - if (ctx->rx.buffer) { - g_free (ctx->rx.buffer); - ctx->rx.buffer = NULL; - } - if (ctx->dest_mask) { g_free (ctx->dest_mask); ctx->dest_mask = NULL; diff --git a/src/fileopctx.c b/src/fileopctx.c index d5ace38bd..2cd6aa98e 100644 --- a/src/fileopctx.c +++ b/src/fileopctx.c @@ -71,6 +71,8 @@ file_op_context_destroy (FileOpContext *ctx) if (ctx->ui) file_op_context_destroy_ui (ctx); + regfree (&ctx->rx); + /* FIXME: do we need to free ctx->dest_mask? */ g_free (ctx);