From: alex Date: Mon, 25 Apr 2022 05:33:51 +0000 (-0700) Subject: ... X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=90cde4acb587de74d18f47656a9f951fbe1f7a4b;p=seeder ... --- diff --git a/src/add.c b/src/add.c index 75fe2e7..3afaacb 100644 --- a/src/add.c +++ b/src/add.c @@ -87,6 +87,12 @@ static void *add_hash(void *unused) { 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); } @@ -125,7 +131,7 @@ static int add_queue_entry_add_torrent(struct add_queue_entry *entry,struct torr 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;