Ethereal-cvs: [ethereal-cvs] cvs commit: ethereal/gtk main.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Gilbert Ramirez Jr." <gram@xxxxxxxxxxxx>
Date: Wed, 1 Dec 1999 23:26:04 -0600 (CST)
gram        1999/12/01 23:26:02 CST

  Modified files:
    gtk                  main.c 
  Log:
  Fix bug which occurs when running ethereal with "-r" to load a file, then
  loading a new file from within ethereal.
  
  In main(), cf_name was being set to optarg, without g_strdup()'ing it.
  Later, in file_open_cmd_cb(), we try to g_free last_open_dir, which is
  cf_name, so blammo! We try to g_free something that we can't.
  
  So, in main(), be sure to set cf_name to a g_strdup() of optarg, not
  just optarg.
  
  (At home I'm using debug/development versions of glib/gtk, so maybe
  that's why I saw the problem only now. I could have sworn that I
  have done this sequence of events successfully before).
  
  Revision  Changes    Path
  1.59      +2 -2      ethereal/gtk/main.c