summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <hg@njw.me.uk>2011-07-16 23:15:40 +0100
committerNick White <hg@njw.me.uk>2011-07-16 23:15:40 +0100
commitdc5eb36ac3a77bce841fafbef996bf4466ff7519 (patch)
tree3218560a82e7ad6d40478fc9cf4b2b04bd800615
parent7bfdd55ef327f4a15be78ad4505953006390340a (diff)
Close socket handle after use
-rw-r--r--TODO2
-rw-r--r--util.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/TODO b/TODO
index c5fdd46..2ee5e68 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,3 @@
-only dial once; use a global file handle for this (may need to be extern)
-
use order to be able to use real page numbers (getpagecode)
to find this advance through click3 letter by letter until either } (none found) or strcmp "order"
diff --git a/util.c b/util.c
index 1017b1b..47facef 100644
--- a/util.c
+++ b/util.c
@@ -57,6 +57,7 @@ int get(char *host, char *path, char **buf) {
for(l=0; (res = fread(*buf+l, 1, 4096, srv)) > 0; l+=res)
*buf = realloc(*buf, sizeof(char *) * (l+4096));
+ fclose(srv);
return l;
}