aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2014-03-23 00:42:18 -0400
committerNick Mathewson <nickm@torproject.org>2014-03-23 15:53:51 -0400
commiteff16e834b409fbd46087b303a4982b4f8b3fefa (patch)
treeb6e5b36e1e6ba4c20bd1e0e1c721d82d8add0acc /src
parenta83abcf5ee5cb8fe245bc97e089e082f62921194 (diff)
downloadtor-eff16e834b409fbd46087b303a4982b4f8b3fefa.tar
tor-eff16e834b409fbd46087b303a4982b4f8b3fefa.tar.gz
Stop leaking 'sig' at each call of router_append_dirobj_signature()
The refactoring in commit cb75519b (tor 0.2.4.13-alpha) introduced this leak.
Diffstat (limited to 'src')
-rw-r--r--src/or/routerparse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 3aa4bdf8a..a6ba66967 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -728,7 +728,7 @@ router_get_dirobj_signature(const char *digest,
/** Helper: used to generate signatures for routers, directories and
* network-status objects. Given a digest in <b>digest</b> and a secret
- * <b>private_key</b>, generate an PKCS1-padded signature, BASE64-encode it,
+ * <b>private_key</b>, generate a PKCS1-padded signature, BASE64-encode it,
* surround it with -----BEGIN/END----- pairs, and write it to the
* <b>buf_len</b>-byte buffer at <b>buf</b>. Return 0 on success, -1 on
* failure.
@@ -751,6 +751,7 @@ router_append_dirobj_signature(char *buf, size_t buf_len, const char *digest,
return -1;
}
memcpy(buf+s_len, sig, sig_len+1);
+ tor_free(sig);
return 0;
}