dirmngr: Fix possible null reference.

* dirmngr/dns.c (dns_error_t dns_trace_fput): Check NULL.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2017-04-12 15:58:11 +09:00
parent 7b4edf14bb
commit 7ae1857c90
1 changed files with 3 additions and 2 deletions

View File

@ -4606,8 +4606,9 @@ dns_error_t dns_trace_fput(const struct dns_trace_event *te, const void *data, s
if (fwrite(&tmp, 1, headsize, fp) < headsize)
return errno;
if (fwrite(data, 1, datasize, fp) < datasize)
return errno;
if (data)
if (fwrite(data, 1, datasize, fp) < datasize)
return errno;
if (fflush(fp))
return errno;