mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
* 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.
This commit is contained in:
parent
c054b3783f
commit
4cec4a2058
@ -1,5 +1,10 @@
|
|||||||
2002-12-26 Pavel Roskin <proski@gnu.org>
|
2002-12-26 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* 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.
|
* layout.c (setup_panels): Clean the hint bar if it's enabled.
|
||||||
Bug reported by Adam Byrtek <alpha@debian.org>
|
Bug reported by Adam Byrtek <alpha@debian.org>
|
||||||
|
|
||||||
|
12
src/file.c
12
src/file.c
@ -1836,7 +1836,6 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||||||
ctx = file_op_context_new ();
|
ctx = file_op_context_new ();
|
||||||
|
|
||||||
do_bg = 0;
|
do_bg = 0;
|
||||||
ctx->rx.buffer = NULL;
|
|
||||||
free_linklist (&linklist);
|
free_linklist (&linklist);
|
||||||
free_linklist (&dest_dirs);
|
free_linklist (&dest_dirs);
|
||||||
if (get_current_type () == view_listing)
|
if (get_current_type () == view_listing)
|
||||||
@ -1864,10 +1863,6 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else if (operation != OP_DELETE) {
|
} 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) {
|
if (ask_user) {
|
||||||
char *dest_dir;
|
char *dest_dir;
|
||||||
|
|
||||||
@ -1882,12 +1877,10 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||||||
file_mask_dialog (ctx, operation, cmd_buf, dest_dir,
|
file_mask_dialog (ctx, operation, cmd_buf, dest_dir,
|
||||||
only_one, &do_bg);
|
only_one, &do_bg);
|
||||||
if (!dest) {
|
if (!dest) {
|
||||||
g_free (ctx->rx.buffer);
|
|
||||||
file_op_context_destroy (ctx);
|
file_op_context_destroy (ctx);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!*dest) {
|
if (!*dest) {
|
||||||
g_free (ctx->rx.buffer);
|
|
||||||
file_op_context_destroy (ctx);
|
file_op_context_destroy (ctx);
|
||||||
g_free (dest);
|
g_free (dest);
|
||||||
return 0;
|
return 0;
|
||||||
@ -2153,11 +2146,6 @@ panel_operate (void *source_panel, FileOperation operation,
|
|||||||
if (temp)
|
if (temp)
|
||||||
g_free (temp);
|
g_free (temp);
|
||||||
|
|
||||||
if (ctx->rx.buffer) {
|
|
||||||
g_free (ctx->rx.buffer);
|
|
||||||
ctx->rx.buffer = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->dest_mask) {
|
if (ctx->dest_mask) {
|
||||||
g_free (ctx->dest_mask);
|
g_free (ctx->dest_mask);
|
||||||
ctx->dest_mask = NULL;
|
ctx->dest_mask = NULL;
|
||||||
|
@ -71,6 +71,8 @@ file_op_context_destroy (FileOpContext *ctx)
|
|||||||
if (ctx->ui)
|
if (ctx->ui)
|
||||||
file_op_context_destroy_ui (ctx);
|
file_op_context_destroy_ui (ctx);
|
||||||
|
|
||||||
|
regfree (&ctx->rx);
|
||||||
|
|
||||||
/* FIXME: do we need to free ctx->dest_mask? */
|
/* FIXME: do we need to free ctx->dest_mask? */
|
||||||
|
|
||||||
g_free (ctx);
|
g_free (ctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user