From 80f7fe773970de3c087a6518c9b48ea8c019e721 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 13 Feb 2021 02:23:01 +0800 Subject: [PATCH] dtfile: fix a segmentation fault that occurred when drag and drop file with the same name. --- cde/programs/dtfile/OverWrite.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtfile/OverWrite.c b/cde/programs/dtfile/OverWrite.c index dc73bbb3b..59fb7bbab 100644 --- a/cde/programs/dtfile/OverWrite.c +++ b/cde/programs/dtfile/OverWrite.c @@ -1153,9 +1153,14 @@ create_replace_rename_dialog(Widget parent_widget, XtFree(title); - XtFree(actions.actionList[1].label); - actions.actionList[1].label = orig_label; + + if (actions.actionList[1].label != orig_label) { + XtFree(actions.actionList[1].label); + actions.actionList[1].label = orig_label; + } + actions.actionList[1].msg_num = orig_msg_num; + return; } /* end create_replace_rename_dialog */