Fix potential leak of newdc in make_first_dc()

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2014-07-10 22:11:42 +02:00 committed by Dirk Hohndel
parent 6b4dd8d597
commit 1a8e8be3a9

1
dive.c
View file

@ -2466,6 +2466,7 @@ void make_first_dc()
while (dc && dc->next != cur_dc)
dc = dc->next;
if (!dc) {
free(newdc);
fprintf(stderr, "data inconsistent: can't find the current DC");
return;
}