Make unparsehash return a static buf.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 16 Oct 2005 03:42:39 +0000 (03:42 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 16 Oct 2005 03:42:39 +0000 (03:42 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@377 959494ce-11ee-0310-bf91-de5d638817bd

daemon/client.c

index 1bf2420..bf7a3af 100644 (file)
@@ -178,10 +178,13 @@ struct hash *parsehash(wchar_t *text)
 
 wchar_t *unparsehash(struct hash *hash)
 {
-    wchar_t *buf, *whbuf;
+    static wchar_t *buf = NULL;
+    wchar_t *whbuf;
     char *hbuf;
     size_t bufsize, bufdata;
     
+    if(buf != NULL)
+       free(buf);
     buf = NULL;
     bufsize = bufdata = 0;
     hbuf = base64encode(hash->buf, hash->len);