Fix unmatched temporary buffer allocations
[yaffs2.git] / yaffs_guts.c
index a2b4cdf696114a2d89ab639c1ab0f35ee126221b..3e33916b16045824f25cde00d2a0b3ea329a926c 100644 (file)
@@ -3017,8 +3017,10 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
 
        result = yaffs_rd_chunk_tags_nand(dev, in->hdr_chunk, buf, &tags);
 
-       if (result == YAFFS_FAIL)
+       if (result == YAFFS_FAIL) {
+               yaffs_release_temp_buffer(dev, buf);
                return;
+       }
 
        oh = (struct yaffs_obj_hdr *)buf;
 
@@ -3201,7 +3203,6 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR *name, int force,
                bi->has_shrink_hdr = 1;
        }
 
-
        return new_chunk_id;
 }