This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 4485127e4eb02c55a4bdebbd36239c9a5a58d577
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Nov 26 18:14:14 2021 +0000
gfs2_edit: Don't free buf in save_leaf_chain()
Each buffer passed to this function is an offset in a larger allocation
so freeing them can be left until later.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 5ccc46a8..0b0b7963 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -811,16 +811,13 @@ static int save_leaf_chain(struct metafd *mfd, struct gfs2_sbd *sdp,
char *buf)
if (r != sdp->sd_bsize) {
fprintf(stderr, "Failed to read leaf block %"PRIx64": %s\n",
blk, strerror(errno));
- free(buf);
return 1;
}
report_progress(blk, 0);
if (gfs2_check_meta(buf, GFS2_METATYPE_LF) == 0) {
int ret = save_buf(mfd, buf, blk, sdp->sd_bsize);
- if (ret != 0) {
- free(buf);
+ if (ret != 0)
return ret;
- }
}
leaf = (struct gfs2_leaf *)buf;
}
@@ -838,8 +835,7 @@ static void save_leaf_blocks(struct metafd *mfd, struct
block_range_queue *q)
save_leaf_chain(mfd, &sbd, buf);
}
q->tail = br->next;
- free(br->buf);
- free(br);
+ block_range_free(&br);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date