Browse Source

Stopped memory leak in continuation cards when removing old cards.

pre-master-46
Brian Taylor 4 years ago
committed by Holger Vogt
parent
commit
1fb533a3d4
  1. 9
      src/frontend/inpcom.c

9
src/frontend/inpcom.c

@ -8311,12 +8311,17 @@ static struct card *the_last_card(struct card *startcard)
}
static void remove_old_cards(struct card *first, struct card *stop)
{
struct card *x, *next = NULL;
struct card *x, *y, *next = NULL, *nexta = NULL;
if (!first || !stop || (first == stop)) { return; }
for (x = first; (x && (x != stop)); x = next) {
//printf("Remove %s\n", x->line);
if (x->line) { tfree(x->line); }
if (x->error) { tfree(x->error); }
for (y = x->actualLine; y; y = nexta) {
if (y->line) { tfree(y->line); }
if (y->error) { tfree(y->error); }
nexta = y->nextcard;
tfree(y);
}
next = x->nextcard;
tfree(x);
}

Loading…
Cancel
Save