]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/vcard.c
Handle situation in where we have multiple buffers to send at the end.
[citadel.git] / libcitadel / lib / vcard.c
index d23e6d6d953854f447ff9fd8082e6b88b946d201..3264774d7405ac6274f0896ed1ff7635d792290b 100644 (file)
@@ -138,12 +138,14 @@ struct vCard *vcard_load(char *vtext) {
        }
 
        v = vcard_new();
-       if (v == NULL) return v;
+       if (v == NULL)
+       {
+               free(mycopy);
+               return v;
+       }
 
        ptr = mycopy;
        while (!IsEmptyStr(ptr)) {
-               colonpos = (-1);
-               nlpos = (-1);
                colonpos = pattern2(ptr, ":");
                nlpos = pattern2(ptr, "\n");