From b9bd749e23bfa32652169d27fa48bae86bd01071 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 21 Mar 2010 16:19:34 +0300 Subject: [PATCH] Fixed segfaults in standalone diff viewer. Signed-off-by: Andrew Borodin --- src/cmd.c | 7 +++++-- src/diffviewer/ydiff.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 15d8e8811..1078e9f94 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -326,8 +326,11 @@ do_edit_at_line (const char *what, int start_line) } execute_with_vfs_arg (editor, what); } - update_panels (UP_OPTIMIZE, UP_KEEPSEL); - repaint_screen (); + if (mc_run_mode == MC_RUN_FULL) + { + update_panels (UP_OPTIMIZE, UP_KEEPSEL); + repaint_screen (); + } } static void diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index 0884dd647..96357560f 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -1629,7 +1629,7 @@ static void cc_free_elt (void *elt) { DIFFLN *p = elt; - if (p->p) + if (p != NULL) { g_free (p->p); }