summaryrefslogtreecommitdiffstats
path: root/pattern.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-10-14 15:13:54 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-10-14 15:13:54 +0000
commitedd53e700cdc5e72813686b1903c0d98415d0248 (patch)
treea579cab34b5c13a8009fd915e467810caaed1487 /pattern.c
parentbb008e2a49839e33763dc10afce02581189c6b8a (diff)
Fix a segmentation fault when search PGP-encrypted messages.
Diffstat (limited to 'pattern.c')
-rw-r--r--pattern.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pattern.c b/pattern.c
index fcb055bf..8ed9bf41 100644
--- a/pattern.c
+++ b/pattern.c
@@ -164,8 +164,11 @@ msg_search (CONTEXT *ctx, regex_t *rx, char *buf, size_t blen, int op, int msgno
if (h->pgp & PGPENCRYPT && !pgp_valid_passphrase())
{
mx_close_message (&msg);
- fclose (fp);
- unlink (tempfile);
+ if (fp)
+ {
+ fclose (fp);
+ unlink (tempfile);
+ }
return (0);
}
#endif