diff options
author | Werner Koch <wk@gnupg.org> | 2014-09-10 09:15:57 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-09-10 09:29:52 +0200 |
commit | 3b20cc21de86ac8a475bdefd3aebb02a12fb8d0b (patch) | |
tree | d7d63b0b1bce565ace4139ff39e0e59563f23805 /common/http.c | |
parent | Merge branch 'wk/test-gpgrt-estream' (diff) | |
download | gnupg2-3b20cc21de86ac8a475bdefd3aebb02a12fb8d0b.tar.xz gnupg2-3b20cc21de86ac8a475bdefd3aebb02a12fb8d0b.zip |
dirmngr: Fix the ks_fetch command for the http scheme.
* common/http.c (http_session_ref): Allow for NULL arg.
--
We always test for a an existing session and thus passing NULL as
session object should be allowed.
Reported-by: Jens Lechtenboerger
Diffstat (limited to '')
-rw-r--r-- | common/http.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/common/http.c b/common/http.c index fe83e3fbc..7e3bb5717 100644 --- a/common/http.c +++ b/common/http.c @@ -636,12 +636,17 @@ http_session_new (http_session_t *r_session, const char *tls_priority) } -/* Increment the reference count for session SESS. */ +/* Increment the reference count for session SESS. Passing NULL for + SESS is allowed. */ http_session_t http_session_ref (http_session_t sess) { - sess->refcount++; - /* log_debug ("http.c:session_ref: sess %p ref now %d\n", sess, sess->refcount); */ + if (sess) + { + sess->refcount++; + /* log_debug ("http.c:session_ref: sess %p ref now %d\n", sess, */ + /* sess->refcount); */ + } return sess; } |