diff options
Diffstat (limited to 'cmds-send.c')
-rw-r--r-- | cmds-send.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmds-send.c b/cmds-send.c index a0b7f95f..95fd4aaa 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -174,11 +174,16 @@ out: static int add_clone_source(struct btrfs_send *s, u64 root_id) { + void *tmp; + + tmp = s->clone_sources; s->clone_sources = realloc(s->clone_sources, sizeof(*s->clone_sources) * (s->clone_sources_count + 1)); - if (!s->clone_sources) + if (!s->clone_sources) { + free(tmp); return -ENOMEM; + } s->clone_sources[s->clone_sources_count++] = root_id; return 0; |