Plug FILE leak on show_first_tel() error paths

Leak introduced in commit 4238323d, v4.3.20.  Unlikely to bite in
practice, as only corrupt mailbox files can cause these errors.
This commit is contained in:
Markus Armbruster 2011-10-29 15:35:43 +02:00
parent 8e391f29a1
commit 0b66d8e281

View file

@ -209,6 +209,7 @@ int
show_first_tel(char *fname)
{
FILE *fp;
int ret;
struct telstr tgm;
if ((fp = fopen(fname, "rb")) == NULL) {
@ -219,12 +220,15 @@ show_first_tel(char *fname)
return -1;
}
}
if (tel_read_header(fp, fname, &tgm) < 0)
return -1;
if (tel_read_body(fp, fname, &tgm, print_sink, NULL) < 0)
return -1;
ret = tel_read_header(fp, fname, &tgm);
if (ret < 0)
goto out;
ret = tel_read_body(fp, fname, &tgm, print_sink, NULL);
out:
fclose(fp);
return 0;
return ret;
}
static int