log_info(ADD_MESSAGE_ADDED_FILE,p->file->path);
+ /*
+ * add_queue_entry_free free's struct file
+ * if pointer is not NULL; since add was successful,
+ * that is unnecessary.
+ */
+ p->file = NULL;
add_queue_entry_free(p);
}
static void add_queue_entry_free(struct add_queue_entry *p) {
struct add_queue_torrent *to_free;
- file_free(p->file);
+ if(p->file!=NULL) { file_free(p->file); }
while(p->torrents!=NULL) {
to_free = p->torrents;