summaryrefslogtreecommitdiffstats
path: root/tools/sockprox.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-04-15 16:40:48 +0200
committerWerner Koch <wk@gnupg.org>2014-04-16 10:18:17 +0200
commita34afa8f2053d75f276d6d28dbf1a43db0fd9768 (patch)
tree68526edee70449f07cea73af77424664193a559f /tools/sockprox.c
parentgpg: Re-enable secret key deletion. (diff)
downloadgnupg2-a34afa8f2053d75f276d6d28dbf1a43db0fd9768.tar.xz
gnupg2-a34afa8f2053d75f276d6d28dbf1a43db0fd9768.zip
Two minor code cleanups and one NULL deref on error fix.
* common/estream.c (es_freopen): Remove useless check for STREAM. * kbx/keybox-blob.c (_keybox_create_x509_blob): Remove useless check for BLOB. * tools/sockprox.c (run_proxy): Do not fclose(NULL). -- Found by Hans-Christoph Steiner with cppcheck.
Diffstat (limited to 'tools/sockprox.c')
-rw-r--r--tools/sockprox.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/sockprox.c b/tools/sockprox.c
index 9ec89ce25..35935987a 100644
--- a/tools/sockprox.c
+++ b/tools/sockprox.c
@@ -443,7 +443,8 @@ run_proxy (void)
out:
pthread_attr_destroy (&thread_attr);
- fclose (protocol_file); /* FIXME, err checking. */
+ if (protocol_file)
+ fclose (protocol_file); /* FIXME, err checking. */
return err;
}