]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in disk_state_parse_commits().
authorAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 09:28:00 +0000 (11:28 +0200)
committerAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 11:10:57 +0000 (13:10 +0200)
This patch fixes a memory leak in disk_state_parse_commits() where if
commit is NULL, we continue the internal loop, but without ever freeing
the args variable.

See: Coverity CID 1437441.

src/or/shared_random_state.c

index 87db9031ee69047ec278d6bcea20afc3521ffd0f..8438d4640473f61e19073979351a963c14684eb7 100644 (file)
@@ -409,6 +409,7 @@ disk_state_parse_commits(sr_state_t *state,
     if (commit == NULL) {
       /* Ignore badly formed commit. It could also be a authority
        * fingerprint that we don't know about so it shouldn't be used. */
+      smartlist_free(args);
       continue;
     }
     /* We consider parseable commit from our disk state to be valid because