VCARD: in case of OOM, don't loose more memory.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 21 Oct 2012 20:43:55 +0000 (22:43 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 21 Oct 2012 20:43:55 +0000 (22:43 +0200)
libcitadel/lib/vcard.c

index 8c0c79d1ca37a9ea391857e57c9970eb5fa78dbd..3264774d7405ac6274f0896ed1ff7635d792290b 100644 (file)
@@ -138,7 +138,11 @@ 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)) {