Make unparsehash return a static buf.
[doldaconnect.git] / 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);