Changeset 468


Ignore:
Timestamp:
Jun 25, 2006, 7:03:54 PM (16 years ago)
Author:
joshe
Message:

Fix drag-and-drop.
It's better to use memory before you free it, not after.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r410 r468  
    562562  struct stat sb;
    563563  int prelen = strlen(prefix);
    564   GList *paths;
     564  GList *paths, *freeables;
    565565
    566566#ifdef DND_DEBUG
     
    583583  errs = NULL;
    584584  paths = NULL;
     585  freeables = NULL;
    585586  if(gdk_atom_intern("XdndSelection", FALSE) == sel->selection &&
    586587     8 == sel->format) {
     
    601602        /* de-urlencode the URI */
    602603        decoded = urldecode(files + ii, len);
     604        freeables = g_list_append(freeables, decoded);
    603605        if(g_utf8_validate(decoded, -1, NULL)) {
    604606          /* remove the file: prefix */
     
    617619          }
    618620        }
    619         g_free(decoded);
    620621      }
    621622    }
    622623
    623624    /* try to add any torrents we found */
    624     if(NULL != paths) {
     625    if(NULL != paths)
    625626      addtorrents(data, NULL, paths, NULL,
    626627                  addactionflag(cf_getpref(PREF_ADDSTD)));
    627       freestrlist(paths);
    628     }
     628    freestrlist(freeables);
    629629    g_free(files);
    630630  }
Note: See TracChangeset for help on using the changeset viewer.