]> arthur.barton.de Git - netatalk.git/commitdiff
Fix realloc
authorFrank Lahm <franklahm@googlemail.com>
Mon, 20 Dec 2010 12:53:41 +0000 (13:53 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 20 Dec 2010 12:53:41 +0000 (13:53 +0100)
libatalk/adouble/ad_write.c

index dc6ee839862b7740f046638f32a5d14c831d8fcb..65e3ca2d76005d4e3d6fbc5f91bb2c7427504ab2 100644 (file)
@@ -86,7 +86,7 @@ ssize_t ad_write(struct adouble *ad, uint32_t eid, off_t off, int end, const cha
         } else { /* AD_VERSION_EA */
             if ((off + buflen) > ad->ad_resforkbufsize) {
                 size_t roundup = (((off + buflen) / RFORK_EA_ALLOCSIZE) + 1) * RFORK_EA_ALLOCSIZE;
-                if ((ad->ad_resforkbuf = realloc(roundup)) == NULL)
+                if ((ad->ad_resforkbuf = realloc(ad->ad_resforkbuf, roundup)) == NULL)
                     return -1;
                 ad->ad_resforkbufsize = roundup;
             }