]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/json.c
* fix memleaks
[citadel.git] / libcitadel / lib / json.c
index 8690f4e2b7b3d851fbc86e281b766d914de19339..9c941bc626436755706e0fce9749d76b3152f8e2 100644 (file)
@@ -219,6 +219,7 @@ void SerializeJson(StrBuf *Target, JsonValue *Val, int FreeVal)
                        vPrevious = vValue;
                }
                StrBufAppendBufPlain(Target, HKEY("]"), 0);
+               DeleteHashPos(&It);
                break;
        case JSON_OBJECT:
                vPrevious = NULL;
@@ -241,6 +242,7 @@ void SerializeJson(StrBuf *Target, JsonValue *Val, int FreeVal)
                        vPrevious = vValue;
                }
                StrBufAppendBufPlain(Target, HKEY("}"), 0);
+               DeleteHashPos(&It);
                break;
        }
        if(FreeVal) {