[CRIU] [PATCH 1/2] Get rid of xfree()
Kir Kolyshkin
kir at openvz.org
Mon Oct 19 17:27:21 PDT 2015
Contrary to a popular opinion, there is no need to check
an argument for being non-NULL before calling free().
>From free(3) man page:
> If ptr is NULL, no operation is performed.
Let's remove xfree() macro and replace all calls to free().
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
aio.c | 4 ++--
arch/aarch64/crtools.c | 10 +++++-----
arch/arm/crtools.c | 8 ++++----
arch/ppc64/crtools.c | 24 ++++++++++++------------
arch/x86/crtools.c | 8 ++++----
cgroup.c | 34 +++++++++++++++++-----------------
cr-dump.c | 8 ++++----
cr-restore.c | 10 +++++-----
cr-show.c | 10 +++++-----
file-lock.c | 2 +-
files-reg.c | 8 ++++----
files.c | 6 +++---
fsnotify.c | 4 ++--
image.c | 18 +++++++++---------
include/xmalloc.h | 2 --
ipc_ns.c | 12 ++++++------
irmap.c | 10 +++++-----
mem.c | 2 +-
mount.c | 14 +++++++-------
namespaces.c | 20 ++++++++++----------
net.c | 8 ++++----
page-pipe.c | 6 +++---
page-read.c | 6 +++---
page-xfer.c | 4 ++--
pagemap-cache.c | 2 +-
parasite-syscall.c | 2 +-
pipes.c | 2 +-
plugin.c | 6 +++---
proc_parse.c | 46 +++++++++++++++++++++++-----------------------
protobuf.c | 4 ++--
pstree.c | 16 ++++++++--------
seize.c | 8 ++++----
shmem.c | 4 ++--
sk-inet.c | 6 +++---
sk-netlink.c | 2 +-
sk-packet.c | 14 +++++++-------
sk-queue.c | 12 ++++++------
sk-tcp.c | 8 ++++----
sk-unix.c | 14 +++++++-------
sockets.c | 12 ++++++------
sysctl.c | 4 ++--
sysfs_parse.c | 4 ++--
tty.c | 10 +++++-----
tun.c | 2 +-
util.c | 4 ++--
vdso.c | 4 ++--
46 files changed, 211 insertions(+), 213 deletions(-)
diff --git a/aio.c b/aio.c
index 9965efd..d1b0478 100644
--- a/aio.c
+++ b/aio.c
@@ -39,8 +39,8 @@ void free_aios(MmEntry *mme)
if (mme->aios) {
for (i = 0; i < mme->n_aios; i++)
- xfree(mme->aios[i]);
- xfree(mme->aios);
+ free(mme->aios[i]);
+ free(mme->aios);
}
}
diff --git a/arch/aarch64/crtools.c b/arch/aarch64/crtools.c
index 9dc2777..56ce817 100644
--- a/arch/aarch64/crtools.c
+++ b/arch/aarch64/crtools.c
@@ -170,12 +170,12 @@ void arch_free_thread_info(CoreEntry *core)
{
if (CORE_THREAD_ARCH_INFO(core)) {
if (CORE_THREAD_ARCH_INFO(core)->fpsimd) {
- xfree(CORE_THREAD_ARCH_INFO(core)->fpsimd->vregs);
- xfree(CORE_THREAD_ARCH_INFO(core)->fpsimd);
+ free(CORE_THREAD_ARCH_INFO(core)->fpsimd->vregs);
+ free(CORE_THREAD_ARCH_INFO(core)->fpsimd);
}
- xfree(CORE_THREAD_ARCH_INFO(core)->gpregs->regs);
- xfree(CORE_THREAD_ARCH_INFO(core)->gpregs);
- xfree(CORE_THREAD_ARCH_INFO(core));
+ free(CORE_THREAD_ARCH_INFO(core)->gpregs->regs);
+ free(CORE_THREAD_ARCH_INFO(core)->gpregs);
+ free(CORE_THREAD_ARCH_INFO(core));
CORE_THREAD_ARCH_INFO(core) = NULL;
}
}
diff --git a/arch/arm/crtools.c b/arch/arm/crtools.c
index 66405d2..d95478a 100644
--- a/arch/arm/crtools.c
+++ b/arch/arm/crtools.c
@@ -181,11 +181,11 @@ void arch_free_thread_info(CoreEntry *core)
{
if (CORE_THREAD_ARCH_INFO(core)) {
if (CORE_THREAD_ARCH_INFO(core)->fpstate) {
- xfree(CORE_THREAD_ARCH_INFO(core)->fpstate->vfp_regs);
- xfree(CORE_THREAD_ARCH_INFO(core)->fpstate);
+ free(CORE_THREAD_ARCH_INFO(core)->fpstate->vfp_regs);
+ free(CORE_THREAD_ARCH_INFO(core)->fpstate);
}
- xfree(CORE_THREAD_ARCH_INFO(core)->gpregs);
- xfree(CORE_THREAD_ARCH_INFO(core));
+ free(CORE_THREAD_ARCH_INFO(core)->gpregs);
+ free(CORE_THREAD_ARCH_INFO(core));
CORE_THREAD_ARCH_INFO(core) = NULL;
}
}
diff --git a/arch/ppc64/crtools.c b/arch/ppc64/crtools.c
index 99a0add..8b7b76f 100644
--- a/arch/ppc64/crtools.c
+++ b/arch/ppc64/crtools.c
@@ -138,7 +138,7 @@ static int get_fpu_regs(pid_t pid, CoreEntry *core)
fpe->n_fpregs = NFPREG;
fpe->fpregs = xmalloc(fpe->n_fpregs * sizeof(fpe->fpregs[0]));
if (!fpe->fpregs) {
- xfree(fpe);
+ free(fpe);
return -1;
}
@@ -197,7 +197,7 @@ static int get_altivec_regs(pid_t pid, CoreEntry *core)
vse->n_vrregs = 33 * 2; /* protocol buffer store 64bit entries */
vse->vrregs = xmalloc(vse->n_vrregs * sizeof(vse->vrregs[0]));
if (!vse->vrregs) {
- xfree(vse);
+ free(vse);
return -1;
}
@@ -286,7 +286,7 @@ static int get_vsx_regs(pid_t pid, CoreEntry *core)
vse->n_vsxregs = 32;
vse->vsxregs = xmalloc(vse->n_vsxregs * sizeof(vse->vsxregs[0]));
if (!vse->vsxregs) {
- xfree(vse);
+ free(vse);
return -1;
}
@@ -424,20 +424,20 @@ void arch_free_thread_info(CoreEntry *core)
{
if (CORE_THREAD_ARCH_INFO(core)) {
if (CORE_THREAD_ARCH_INFO(core)->fpstate) {
- xfree(CORE_THREAD_ARCH_INFO(core)->fpstate->fpregs);
- xfree(CORE_THREAD_ARCH_INFO(core)->fpstate);
+ free(CORE_THREAD_ARCH_INFO(core)->fpstate->fpregs);
+ free(CORE_THREAD_ARCH_INFO(core)->fpstate);
}
if (CORE_THREAD_ARCH_INFO(core)->vrstate) {
- xfree(CORE_THREAD_ARCH_INFO(core)->vrstate->vrregs);
- xfree(CORE_THREAD_ARCH_INFO(core)->vrstate);
+ free(CORE_THREAD_ARCH_INFO(core)->vrstate->vrregs);
+ free(CORE_THREAD_ARCH_INFO(core)->vrstate);
}
if (CORE_THREAD_ARCH_INFO(core)->vsxstate) {
- xfree(CORE_THREAD_ARCH_INFO(core)->vsxstate->vsxregs);
- xfree(CORE_THREAD_ARCH_INFO(core)->vsxstate);
+ free(CORE_THREAD_ARCH_INFO(core)->vsxstate->vsxregs);
+ free(CORE_THREAD_ARCH_INFO(core)->vsxstate);
}
- xfree(CORE_THREAD_ARCH_INFO(core)->gpregs->gpr);
- xfree(CORE_THREAD_ARCH_INFO(core)->gpregs);
- xfree(CORE_THREAD_ARCH_INFO(core));
+ free(CORE_THREAD_ARCH_INFO(core)->gpregs->gpr);
+ free(CORE_THREAD_ARCH_INFO(core)->gpregs);
+ free(CORE_THREAD_ARCH_INFO(core));
CORE_THREAD_ARCH_INFO(core) = NULL;
}
}
diff --git a/arch/x86/crtools.c b/arch/x86/crtools.c
index 1d50c07..5dd4d3c 100644
--- a/arch/x86/crtools.c
+++ b/arch/x86/crtools.c
@@ -294,10 +294,10 @@ void arch_free_thread_info(CoreEntry *core)
return;
if (core->thread_info->fpregs->xsave)
- xfree(core->thread_info->fpregs->xsave->ymmh_space);
- xfree(core->thread_info->fpregs->st_space);
- xfree(core->thread_info->fpregs->xmm_space);
- xfree(core->thread_info);
+ free(core->thread_info->fpregs->xsave->ymmh_space);
+ free(core->thread_info->fpregs->st_space);
+ free(core->thread_info->fpregs->xmm_space);
+ free(core->thread_info);
}
static bool valid_xsave_frame(CoreEntry *core)
diff --git a/cgroup.c b/cgroup.c
index 7d8f1be..461ecb0 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -197,14 +197,14 @@ struct cg_controller *new_controller(const char *name)
nc->controllers = xmalloc(sizeof(char *));
if (!nc->controllers) {
- xfree(nc);
+ free(nc);
return NULL;
}
nc->controllers[0] = xstrdup(name);
if (!nc->controllers[0]) {
- xfree(nc->controllers);
- xfree(nc);
+ free(nc->controllers);
+ free(nc);
return NULL;
}
@@ -344,7 +344,7 @@ static struct cgroup_prop *create_cgroup_prop(const char *name)
property->name = xstrdup(name);
if (!property->name) {
- xfree(property);
+ free(property);
return NULL;
}
@@ -354,9 +354,9 @@ static struct cgroup_prop *create_cgroup_prop(const char *name)
static void free_cgroup_prop(struct cgroup_prop *prop)
{
- xfree(prop->name);
- xfree(prop->value);
- xfree(prop);
+ free(prop->name);
+ free(prop->value);
+ free(prop);
}
static void free_all_cgroup_props(struct cgroup_dir *ncd)
@@ -488,8 +488,8 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
out:
if (ncd)
- xfree(ncd->path);
- xfree(ncd);
+ free(ncd->path);
+ free(ncd);
return exit_code;
}
@@ -640,13 +640,13 @@ static int dump_cg_dir_props(struct list_head *props, size_t n_props,
error:
while (i >= 0) {
- xfree(cpe->name);
- xfree(cpe->value);
+ free(cpe->name);
+ free(cpe->value);
--cpe;
--i;
}
- xfree(*ents);
+ free(*ents);
return -1;
}
@@ -672,7 +672,7 @@ static int dump_cg_dirs(struct list_head *dirs, size_t n_dirs, CgroupDirEntry **
cde->n_children = cur->n_children;
if (cur->n_children > 0)
if (dump_cg_dirs(&cur->children, cur->n_children, &cde->children, strlen(cur->path)) < 0) {
- xfree(*ents);
+ free(*ents);
return -1;
}
@@ -680,7 +680,7 @@ static int dump_cg_dirs(struct list_head *dirs, size_t n_dirs, CgroupDirEntry **
if (cde->n_properties > 0) {
if (dump_cg_dir_props(&cur->properties,
cde->n_properties, &cde->properties) < 0) {
- xfree(*ents);
+ free(*ents);
return -1;
}
}
@@ -714,7 +714,7 @@ static int dump_controllers(CgroupEntry *cg)
ce->n_dirs = cur->n_heads;
if (ce->n_dirs > 0)
if (dump_cg_dirs(&cur->heads, cur->n_heads, &ce->dirs, 0) < 0) {
- xfree(cg->controllers);
+ free(cg->controllers);
return -1;
}
cg->controllers[i++] = ce++;
@@ -958,7 +958,7 @@ void fini_cgroup(void)
close_service_fd(CGROUP_YARD);
umount2(cg_yard, MNT_DETACH);
rmdir(cg_yard);
- xfree(cg_yard);
+ free(cg_yard);
cg_yard = NULL;
}
@@ -1119,7 +1119,7 @@ static int prepare_cgroup_dirs(char **controllers, int n_controllers, char *paux
if (opts.manage_cgroups & (CG_MODE_SOFT | CG_MODE_NONE)) {
pr_info("Skip restoring properties on cgroup dir %s\n", paux);
if (e->n_properties > 0) {
- xfree(e->properties);
+ free(e->properties);
e->properties = NULL;
e->n_properties = 0;
}
diff --git a/cr-dump.c b/cr-dump.c
index fea3be6..da64bbf 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -476,7 +476,7 @@ static int dump_task_mm(pid_t pid, const struct proc_pid_stat *stat,
goto err;
ret = pb_write_one(img_from_set(imgset, CR_FD_MM), &mme, PB_MM);
- xfree(mme.mm_saved_auxv);
+ free(mme.mm_saved_auxv);
free_aios(&mme);
err:
return ret;
@@ -629,7 +629,7 @@ int get_task_ids(struct pstree_item *item)
return 0;
err_free:
- xfree(item->ids);
+ free(item->ids);
item->ids = NULL;
err:
return -1;
@@ -999,7 +999,7 @@ static int fill_zombies_pids(struct pstree_item *item)
BUG_ON(i == nr);
}
- xfree(ch);
+ free(ch);
return 0;
}
@@ -1334,7 +1334,7 @@ static int dump_one_task(struct pstree_item *item)
err:
close_pid_proc();
free_mappings(&vmas);
- xfree(dfds);
+ free(dfds);
return exit_code;
err_cure:
diff --git a/cr-restore.c b/cr-restore.c
index a33273c..edfeaf7 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -808,7 +808,7 @@ static int open_cores(int pid, CoreEntry *leader_core)
return 0;
err:
- xfree(cores);
+ free(cores);
return -1;
}
@@ -1711,7 +1711,7 @@ static void finalize_restore(int status)
parasite_unmap(ctl, (unsigned long)rsti(item)->munmap_restorer);
- xfree(ctl);
+ free(ctl);
if (item->state == TASK_STOPPED)
kill(item->pid.real, SIGSTOP);
@@ -2811,12 +2811,12 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
lsm_profile_len = strlen(rendered);
lsm = rst_mem_alloc(lsm_profile_len + 1, RM_PRIVATE);
if (!lsm) {
- xfree(rendered);
+ free(rendered);
goto err_nv;
}
strncpy(lsm, rendered, lsm_profile_len);
- xfree(rendered);
+ free(rendered);
}
@@ -3056,7 +3056,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
/* No longer need it */
core_entry__free_unpacked(core, NULL);
- xfree(current->core);
+ free(current->core);
/*
* Now prepare run-time data for threads restore.
diff --git a/cr-show.c b/cr-show.c
index 91d4d09..3830427 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -132,11 +132,11 @@ void print_image_data(struct cr_img *img, unsigned int length, int show)
return;
ret = read_img_buf(img, (unsigned char *)data, length);
if (ret < 0) {
- xfree(data);
+ free(data);
return;
}
print_data(0, (unsigned char *)data, length);
- xfree(data);
+ free(data);
}
static void show_pagemaps(struct cr_img *img, void *obj)
@@ -192,7 +192,7 @@ static void pstree_handler(struct cr_img *img, void *obj)
return;
if (pstree_item_from_pb(e, item)) {
- xfree(item);
+ free(item);
return;
}
@@ -550,8 +550,8 @@ static int cr_show_all(void)
out:
list_for_each_entry_safe(item, tmp, &pstree_list, sibling) {
list_del(&item->sibling);
- xfree(item->threads);
- xfree(item);
+ free(item->threads);
+ free(item);
}
return ret;
}
diff --git a/file-lock.c b/file-lock.c
index 8e4e481..eb1588f 100644
--- a/file-lock.c
+++ b/file-lock.c
@@ -63,7 +63,7 @@ void free_file_locks(void)
struct file_lock *flock, *tmp;
list_for_each_entry_safe(flock, tmp, &file_lock_list, list) {
- xfree(flock);
+ free(flock);
}
INIT_LIST_HEAD(&file_lock_list);
diff --git a/files-reg.c b/files-reg.c
index 59d88ca..444af39 100644
--- a/files-reg.c
+++ b/files-reg.c
@@ -88,7 +88,7 @@ static int note_link_remap(char *path, struct ns_id *nsid)
return 0;
err2:
- xfree(rlb);
+ free(rlb);
err:
pr_err("Can't note link remap for %s\n", path);
return -1;
@@ -231,7 +231,7 @@ close_ifd:
err:
if (gfe)
ghost_file_entry__free_unpacked(gfe, NULL);
- xfree(gf->remap.rpath);
+ free(gf->remap.rpath);
shfree_last(gf);
return -1;
}
@@ -603,8 +603,8 @@ static void __rollback_link_remaps(bool do_unlink)
}
list_del(&rlb->list);
- xfree(rlb->path);
- xfree(rlb);
+ free(rlb->path);
+ free(rlb);
}
}
diff --git a/files.c b/files.c
index af1c0f3..38689a5 100644
--- a/files.c
+++ b/files.c
@@ -495,9 +495,9 @@ int dump_task_files_seized(struct parasite_ctl *ctl, struct pstree_item *item,
pr_info("----------------------------------------\n");
err2:
- xfree(opts);
+ free(opts);
err1:
- xfree(lfds);
+ free(lfds);
err:
return ret;
}
@@ -669,7 +669,7 @@ int prepare_ctl_tty(int pid, struct rst_info *rst_info, u32 ctl_tty_id)
e->type = FD_TYPES__TTY;
if (collect_fd(pid, e, rst_info)) {
- xfree(e);
+ free(e);
return -1;
}
diff --git a/fsnotify.c b/fsnotify.c
index a7acc96..6d15a44 100644
--- a/fsnotify.c
+++ b/fsnotify.c
@@ -273,7 +273,7 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
exit_code = 0;
free:
- xfree(ie.wd);
+ free(ie.wd);
list_for_each_entry_safe(we, tmp, &wd_list.list, ify.node)
free_inotify_wd_entry(we);
@@ -386,7 +386,7 @@ static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p)
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_FANOTIFY_FILE), &fe, PB_FANOTIFY_FILE);
free:
- xfree(fe.mark);
+ free(fe.mark);
list_for_each_entry_safe(we, tmp, &wd_list.list, ify.node)
free_fanotify_mark_entry(we);
return ret;
diff --git a/image.c b/image.c
index dc9d6a1..1ca21c7 100644
--- a/image.c
+++ b/image.c
@@ -115,7 +115,7 @@ int write_img_inventory(void)
if (pb_write_one(img, &he, PB_INVENTORY) < 0)
return -1;
- xfree(crt.i.ids);
+ free(crt.i.ids);
close_image(img);
return 0;
}
@@ -137,7 +137,7 @@ static struct cr_imgset *alloc_cr_imgset(int nr)
cr_imgset->_imgs = xmalloc(nr * sizeof(struct cr_img *));
if (cr_imgset->_imgs == NULL) {
- xfree(cr_imgset);
+ free(cr_imgset);
return NULL;
}
@@ -169,8 +169,8 @@ void close_cr_imgset(struct cr_imgset **cr_imgset)
__close_cr_imgset(*cr_imgset);
- xfree((*cr_imgset)->_imgs);
- xfree(*cr_imgset);
+ free((*cr_imgset)->_imgs);
+ free(*cr_imgset);
*cr_imgset = NULL;
}
@@ -359,11 +359,11 @@ int open_image_lazy(struct cr_img *img)
dfd = get_service_fd(IMG_FD_OFF);
if (do_open_image(img, dfd, img->type, img->oflags, path)) {
- xfree(path);
+ free(path);
return -1;
}
- xfree(path);
+ free(path);
return 0;
}
@@ -376,11 +376,11 @@ void close_image(struct cr_img *img)
* data from it.
*/
unlinkat(get_service_fd(IMG_FD_OFF), img->path, 0);
- xfree(img->path);
+ free(img->path);
} else if (!empty_image(img))
bclose(&img->_x);
- xfree(img);
+ free(img);
}
struct cr_img *img_from_fd(int fd)
@@ -551,7 +551,7 @@ int read_img_str(struct cr_img *img, char **pstr, int size)
ret = read_img_buf(img, str, size);
if (ret < 0) {
- xfree(str);
+ free(str);
return -1;
}
diff --git a/include/xmalloc.h b/include/xmalloc.h
index 167c3b9..402e2ab 100644
--- a/include/xmalloc.h
+++ b/include/xmalloc.h
@@ -20,8 +20,6 @@
#define xzalloc(size) __xalloc(calloc, size, 1, size)
#define xrealloc(p, size) __xalloc(realloc, size, p, size)
-#define xfree(p) do { if (p) free(p); } while (0)
-
#define xrealloc_safe(pptr, size) \
({ \
int __ret = -1; \
diff --git a/ipc_ns.c b/ipc_ns.c
index 37a9626..8c7f506 100644
--- a/ipc_ns.c
+++ b/ipc_ns.c
@@ -99,7 +99,7 @@ static int dump_ipc_sem_set(struct cr_img *img, const IpcSemEntry *sem)
goto out;
}
out:
- xfree(values);
+ free(values);
return ret;
}
@@ -225,7 +225,7 @@ static int dump_ipc_msg_queue_messages(struct cr_img *img, const IpcMsgEntry *ms
}
ret = 0;
err:
- xfree(message);
+ free(message);
return ret;
}
@@ -430,7 +430,7 @@ static int dump_ipc_var(struct cr_img *img)
}
err:
- xfree(var.sem_ctls);
+ free(var.sem_ctls);
return ret;
}
@@ -485,11 +485,11 @@ void ipc_sem_handler(struct cr_img *img, void *obj)
if (values == NULL)
return;
if (read_img_buf(img, values, size) <= 0) {
- xfree(values);
+ free(values);
return;
}
pr_msg_ipc_sem_array(e->nsems, values);
- xfree(values);
+ free(values);
}
static void ipc_msg_data_handler(struct cr_img *img, void *obj)
@@ -543,7 +543,7 @@ static int prepare_ipc_sem_values(struct cr_img *img, const IpcSemEntry *sem)
ret = -errno;
}
out:
- xfree(values);
+ free(values);
return ret;
}
diff --git a/irmap.c b/irmap.c
index c0926e2..48b5e3a 100644
--- a/irmap.c
+++ b/irmap.c
@@ -164,7 +164,7 @@ static int irmap_update_dir(struct irmap *t)
return 0;
out_err:
- xfree(t->kids);
+ free(t->kids);
closedir(dfd);
close(fd);
return -1;
@@ -218,8 +218,8 @@ static int irmap_revalidate(struct irmap *c, struct irmap **p)
invalid:
pr_debug("\t%x:%lx is invalid\n", c->dev, c->ino);
*p = c->next;
- xfree(c->path);
- xfree(c);
+ free(c->path);
+ free(c);
return 1;
}
@@ -391,7 +391,7 @@ static int irmap_cache_one(IrmapCacheEntry *ie)
ic->ino = ie->inode;
ic->path = xstrdup(ie->path);
if (!ie->path) {
- xfree(ic);
+ free(ic);
return -1;
}
@@ -482,7 +482,7 @@ int irmap_scan_path_add(char *path)
o->ir = xzalloc(sizeof(*o->ir));
if (!o->ir) {
- xfree(o);
+ free(o);
return -1;
}
diff --git a/mem.c b/mem.c
index 989efc3..1362c48 100644
--- a/mem.c
+++ b/mem.c
@@ -434,7 +434,7 @@ int prepare_mm_pid(struct pstree_item *i)
else {
ret = pb_read_one_eof(img, &vma->e, PB_VMA);
if (ret <= 0) {
- xfree(vma);
+ free(vma);
close_image(img);
break;
}
diff --git a/mount.c b/mount.c
index 67e96f2..d7b433e 100644
--- a/mount.c
+++ b/mount.c
@@ -901,7 +901,7 @@ static int resolve_external_mounts(struct mount_info *info)
m->external = em;
- xfree(m->source);
+ free(m->source);
m->source = p;
pr_info("autodetected external mount %s for %s\n", p, m->mountpoint);
@@ -1513,7 +1513,7 @@ bool add_fsname_auto(const char *names)
fsauto_names = NULL;
}
- xfree(old);
+ free(old);
return fsauto_names != NULL;
}
@@ -2312,11 +2312,11 @@ struct mount_info *mnt_entry_alloc()
void mnt_entry_free(struct mount_info *mi)
{
if (mi) {
- xfree(mi->root);
- xfree(mi->mountpoint);
- xfree(mi->source);
- xfree(mi->options);
- xfree(mi);
+ free(mi->root);
+ free(mi->mountpoint);
+ free(mi->source);
+ free(mi->options);
+ free(mi);
}
}
diff --git a/namespaces.c b/namespaces.c
index 4233c59..653ebcb 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -580,13 +580,13 @@ static int parse_id_map(pid_t pid, char *name, UidGidExtent ***pb_exts)
for (i = 0; i < len; i++)
(*pb_exts)[i] = &extents[i];
} else {
- xfree(extents);
+ free(extents);
*pb_exts = NULL;
}
return len;
err:
- xfree(extents);
+ free(extents);
return -1;
}
@@ -693,12 +693,12 @@ int dump_user_ns(pid_t pid, int ns_id)
return 0;
err:
if (e->uid_map) {
- xfree(e->uid_map[0]);
- xfree(e->uid_map);
+ free(e->uid_map[0]);
+ free(e->uid_map);
}
if (e->gid_map) {
- xfree(e->gid_map[0]);
- xfree(e->gid_map);
+ free(e->gid_map[0]);
+ free(e->gid_map);
}
return exit_code;
}
@@ -706,12 +706,12 @@ err:
void free_userns_maps()
{
if (userns_entry.n_uid_map > 0) {
- xfree(userns_entry.uid_map[0]);
- xfree(userns_entry.uid_map);
+ free(userns_entry.uid_map[0]);
+ free(userns_entry.uid_map);
}
if (userns_entry.n_gid_map > 0) {
- xfree(userns_entry.gid_map[0]);
- xfree(userns_entry.gid_map);
+ free(userns_entry.gid_map[0]);
+ free(userns_entry.gid_map);
}
}
diff --git a/net.c b/net.c
index 8473742..967482b 100644
--- a/net.c
+++ b/net.c
@@ -187,7 +187,7 @@ static int dump_one_netdev(int type, struct ifinfomsg *ifi,
ret = dump(&netdev, fds);
err_free:
- xfree(netdev.conf);
+ free(netdev.conf);
return ret;
}
@@ -606,7 +606,7 @@ static int dump_netns_conf(struct cr_imgset *fds)
return -1;
netns.all_conf = xmalloc(sizeof(int) * netns.n_all_conf);
if (!netns.all_conf) {
- xfree(netns.def_conf);
+ free(netns.def_conf);
return -1;
}
@@ -620,8 +620,8 @@ static int dump_netns_conf(struct cr_imgset *fds)
ret = pb_write_one(img_from_set(fds, CR_FD_NETNS), &netns, PB_NETNS);
err_free:
- xfree(netns.def_conf);
- xfree(netns.all_conf);
+ free(netns.def_conf);
+ free(netns.all_conf);
return ret;
}
diff --git a/page-pipe.c b/page-pipe.c
index db58f6a..730bbcf 100644
--- a/page-pipe.c
+++ b/page-pipe.c
@@ -45,7 +45,7 @@ static int page_pipe_grow(struct page_pipe *pp)
return -1;
if (pipe(ppb->p)) {
- xfree(ppb);
+ free(ppb);
pr_perror("Can't make pipe for page-pipe");
return -1;
}
@@ -101,10 +101,10 @@ void destroy_page_pipe(struct page_pipe *pp)
list_for_each_entry_safe(ppb, n, &pp->bufs, l) {
close(ppb->p[0]);
close(ppb->p[1]);
- xfree(ppb);
+ free(ppb);
}
- xfree(pp);
+ free(pp);
}
void page_pipe_reinit(struct page_pipe *pp)
diff --git a/page-read.c b/page-read.c
index 832c057..95e5104 100644
--- a/page-read.c
+++ b/page-read.c
@@ -182,7 +182,7 @@ static void close_page_read(struct page_read *pr)
if (pr->parent) {
close_page_read(pr->parent);
- xfree(pr->parent);
+ free(pr->parent);
}
close_image(pr->pmi);
@@ -208,7 +208,7 @@ static int try_open_parent(int dfd, int pid, struct page_read *pr, int pr_flags)
goto err_free;
if (!ret) {
- xfree(parent);
+ free(parent);
parent = NULL;
}
@@ -218,7 +218,7 @@ out:
return 0;
err_free:
- xfree(parent);
+ free(parent);
err_cl:
close(pfd);
return -1;
diff --git a/page-xfer.c b/page-xfer.c
index e6e64d7..c71a564 100644
--- a/page-xfer.c
+++ b/page-xfer.c
@@ -655,7 +655,7 @@ static void close_page_xfer(struct page_xfer *xfer)
{
if (xfer->parent != NULL) {
xfer->parent->close(xfer->parent);
- xfree(xfer->parent);
+ free(xfer->parent);
xfer->parent = NULL;
}
close_image(xfer->pi);
@@ -755,7 +755,7 @@ static int open_page_local_xfer(struct page_xfer *xfer, int fd_type, long id)
ret = open_page_read_at(pfd, id, xfer->parent, PR_TASK);
if (ret <= 0) {
pr_perror("No parent image found, though parent directory is set");
- xfree(xfer->parent);
+ free(xfer->parent);
xfer->parent = NULL;
close(pfd);
goto out;
diff --git a/pagemap-cache.c b/pagemap-cache.c
index 9ce7b91..a13590e 100644
--- a/pagemap-cache.c
+++ b/pagemap-cache.c
@@ -149,6 +149,6 @@ u64 *pmc_get_map(pmc_t *pmc, struct vma_area *vma)
void pmc_fini(pmc_t *pmc)
{
close_safe(&pmc->fd);
- xfree(pmc->map);
+ free(pmc->map);
pmc_reset(pmc);
}
diff --git a/parasite-syscall.c b/parasite-syscall.c
index ee339db..e39a262 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -1112,7 +1112,7 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
return ctl;
err:
- xfree(ctl);
+ free(ctl);
return NULL;
}
diff --git a/pipes.c b/pipes.c
index 4631231..dbaf1d1 100644
--- a/pipes.c
+++ b/pipes.c
@@ -103,7 +103,7 @@ int collect_pipe_data(int img_type, struct pipe_data_rst **hash)
if (r && r->pde)
pipe_data_entry__free_unpacked(r->pde, NULL);
- xfree(r);
+ free(r);
close_image(img);
return ret;
diff --git a/plugin.c b/plugin.c
index f764ae7..d8d5ea1 100644
--- a/plugin.c
+++ b/plugin.c
@@ -123,7 +123,7 @@ static int cr_lib_load(int stage, char *path)
if (verify_plugin(d)) {
pr_err("Corrupted plugin %s\n", path);
- xfree(this);
+ free(this);
dlclose(h);
return -1;
}
@@ -141,7 +141,7 @@ static int cr_lib_load(int stage, char *path)
if (d->init && d->init(stage)) {
pr_err("Failed in init(%d) of \"%s\"\n", stage, d->name);
list_del(&this->list);
- xfree(this);
+ free(this);
dlclose(h);
return -1;
}
@@ -177,7 +177,7 @@ void cr_plugin_fini(int stage, int ret)
}
if (this->d->version == CRIU_PLUGIN_VERSION_OLD)
- xfree(this->d);
+ free(this->d);
dlclose(h);
}
}
diff --git a/proc_parse.c b/proc_parse.c
index 75ca682..7996745 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -606,7 +606,7 @@ err_n:
if (map_files_dir)
closedir(map_files_dir);
- xfree(vma_area);
+ free(vma_area);
return ret;
}
@@ -1095,7 +1095,7 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new, char **fsname)
ret = 0;
ret:
- xfree(opt);
+ free(opt);
return ret;
err:
ret = -1;
@@ -1234,25 +1234,25 @@ static int alloc_fhandle(FhEntry *fh)
static void free_fhandle(FhEntry *fh)
{
if (fh->handle)
- xfree(fh->handle);
+ free(fh->handle);
}
void free_inotify_wd_entry(union fdinfo_entries *e)
{
free_fhandle(e->ify.e.f_handle);
- xfree(e);
+ free(e);
}
void free_fanotify_mark_entry(union fdinfo_entries *e)
{
if (e->ffy.e.ie)
free_fhandle(e->ffy.ie.f_handle);
- xfree(e);
+ free(e);
}
void free_event_poll_entry(union fdinfo_entries *e)
{
- xfree(e);
+ free(e);
}
static void parse_fhandle_encoded(char *tok, FhEntry *fh)
@@ -1392,7 +1392,7 @@ static int parse_fdinfo_pid_s(int pid, int fd, int type,
}
if (parse_file_lock_buf(str + 6, fl, 0)) {
- xfree(fl);
+ free(fl);
goto parse_err;
}
@@ -1404,7 +1404,7 @@ static int parse_fdinfo_pid_s(int pid, int fd, int type,
if (fl->fl_kind == FL_UNKNOWN) {
pr_err("Unknown file lock!\n");
- xfree(fl);
+ free(fl);
goto out;
}
@@ -1751,7 +1751,7 @@ int parse_file_locks(void)
}
if (parse_file_lock_buf(buf, fl, is_blocked)) {
- xfree(fl);
+ free(fl);
goto err;
}
@@ -1763,7 +1763,7 @@ int parse_file_locks(void)
if (fl->fl_kind == FL_UNKNOWN) {
pr_err("Unknown file lock: %s!\n", buf);
- xfree(fl);
+ free(fl);
goto err;
}
@@ -1773,7 +1773,7 @@ int parse_file_locks(void)
* can't wait any locks.
*/
pr_debug("Skip blocked processes\n");
- xfree(fl);
+ free(fl);
continue;
}
@@ -1784,7 +1784,7 @@ int parse_file_locks(void)
* into dump, so we only collect file locks
* belong to these tasks.
*/
- xfree(fl);
+ free(fl);
continue;
}
@@ -1803,7 +1803,7 @@ void free_posix_timers(struct proc_posix_timers_stat *st)
struct proc_posix_timer *timer;
timer = list_first_entry(&st->timers, struct proc_posix_timer, list);
list_del(&timer->list);
- xfree(timer);
+ free(timer);
}
}
@@ -1902,7 +1902,7 @@ out:
bclose(&f);
return exit_code;
err:
- xfree(timer);
+ free(timer);
free_posix_timers(args);
pr_perror("Parse error in posix timers proc file!");
goto out;
@@ -1932,7 +1932,7 @@ int parse_threads(int pid, struct pid **_t, int *_n)
if (*_t == NULL) {
tmp = xrealloc(t, nr * sizeof(struct pid));
if (!tmp) {
- xfree(t);
+ free(t);
return -1;
}
t = tmp;
@@ -1980,7 +1980,7 @@ int parse_task_cgroup(int pid, struct list_head *retl, unsigned int *n)
path = strchr(++name, ':');
if (!name || !path) {
pr_err("Failed parsing cgroup %s\n", buf);
- xfree(ncc);
+ free(ncc);
goto err;
}
e = strchr(name, '\n');
@@ -1991,9 +1991,9 @@ int parse_task_cgroup(int pid, struct list_head *retl, unsigned int *n)
ncc->name = xstrdup(name);
ncc->path = xstrdup(path);
if (!ncc->name || !ncc->path) {
- xfree(ncc->name);
- xfree(ncc->path);
- xfree(ncc);
+ free(ncc->name);
+ free(ncc->path);
+ free(ncc);
goto err;
}
@@ -2019,9 +2019,9 @@ void put_ctls(struct list_head *l)
struct cg_ctl *c, *n;
list_for_each_entry_safe(c, n, l, l) {
- xfree(c->name);
- xfree(c->path);
- xfree(c);
+ free(c->name);
+ free(c->path);
+ free(c);
}
}
@@ -2189,7 +2189,7 @@ int parse_children(pid_t pid, pid_t **_c, int *_n)
return 0;
err:
closedir(dir);
- xfree(ch);
+ free(ch);
return -1;
}
diff --git a/protobuf.c b/protobuf.c
index ae003da..f272a26 100644
--- a/protobuf.c
+++ b/protobuf.c
@@ -577,7 +577,7 @@ int do_pb_read_one(struct cr_img *img, void **pobj, int type, bool eof)
ret = 1;
err:
if (buf != (void *)&local)
- xfree(buf);
+ free(buf);
return ret;
}
@@ -633,7 +633,7 @@ int pb_write_one(struct cr_img *img, void *obj, int type)
ret = 0;
err:
if (buf != (void *)&local)
- xfree(buf);
+ free(buf);
return ret;
}
diff --git a/pstree.c b/pstree.c
index 18e5a8e..2b05226 100644
--- a/pstree.c
+++ b/pstree.c
@@ -20,9 +20,9 @@ struct pstree_item *root_item;
void core_entry_free(CoreEntry *core)
{
if (core->tc && core->tc->timers)
- xfree(core->tc->timers->posix);
+ free(core->tc->timers->posix);
arch_free_thread_info(core);
- xfree(core);
+ free(core);
}
#ifndef RLIM_NLIMITS
@@ -95,7 +95,7 @@ CoreEntry *core_entry_alloc(int th, int tsk)
thread_sas_entry__init(core->thread_core->sas);
if (arch_alloc_thread_info(core)) {
- xfree(core);
+ free(core);
core = NULL;
}
}
@@ -135,7 +135,7 @@ void pstree_free_cores(struct pstree_item *item)
if (item->core) {
for (i = 1; i < item->nr_threads; i++)
core_entry_free(item->core[i]);
- xfree(item->core);
+ free(item->core);
item->core = NULL;
}
}
@@ -153,8 +153,8 @@ void free_pstree(struct pstree_item *root_item)
parent = item->parent;
list_del(&item->sibling);
pstree_free_cores(item);
- xfree(item->threads);
- xfree(item);
+ free(item->threads);
+ free(item);
item = parent;
}
}
@@ -267,7 +267,7 @@ int dump_pstree(struct pstree_item *root_item)
e.threads[i] = item->threads[i].virt;
ret = pb_write_one(img, &e, PB_PSTREE);
- xfree(e.threads);
+ free(e.threads);
if (ret)
goto err;
@@ -396,7 +396,7 @@ static int read_pstree_image(void)
if (parent == NULL) {
pr_err("Can't find a parent for %d\n", pi->pid.virt);
pstree_entry__free_unpacked(e, NULL);
- xfree(pi);
+ free(pi);
goto err;
}
}
diff --git a/seize.c b/seize.c
index 5ad7ce9..45495c0 100644
--- a/seize.c
+++ b/seize.c
@@ -255,7 +255,7 @@ static int collect_children(struct pstree_item *item)
* really wrong.
*/
ret = 0;
- xfree(c);
+ free(c);
continue;
}
@@ -270,7 +270,7 @@ static int collect_children(struct pstree_item *item)
goto free;
}
free:
- xfree(ch);
+ free(ch);
return ret < 0 ? ret : nr_inprogress;
}
@@ -431,11 +431,11 @@ static int collect_threads(struct pstree_item *item)
goto err;
}
- xfree(threads);
+ free(threads);
return nr_inprogress;
err:
- xfree(threads);
+ free(threads);
return -1;
}
diff --git a/shmem.c b/shmem.c
index b2900f4..6728c17 100644
--- a/shmem.c
+++ b/shmem.c
@@ -419,11 +419,11 @@ err_xfer:
err_pp:
destroy_page_pipe(pp);
err_iovs:
- xfree(iovs);
+ free(iovs);
err_unmap:
munmap(addr, si->size);
err:
- xfree(map);
+ free(map);
return ret;
}
diff --git a/sk-inet.c b/sk-inet.c
index fa41769..eff2874 100644
--- a/sk-inet.c
+++ b/sk-inet.c
@@ -226,7 +226,7 @@ static struct inet_sk_desc *gen_uncon_sk(int lfd, const struct fd_parms *p, int
return sk;
err:
- xfree(sk);
+ free(sk);
return NULL;
}
@@ -320,8 +320,8 @@ static int do_dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p, int fa
}
err:
release_skopts(&skopts);
- xfree(ie.src_addr);
- xfree(ie.dst_addr);
+ free(ie.src_addr);
+ free(ie.dst_addr);
return err;
}
diff --git a/sk-netlink.c b/sk-netlink.c
index a98b26d..3fb584e 100644
--- a/sk-netlink.c
+++ b/sk-netlink.c
@@ -52,7 +52,7 @@ int netlink_receive_one(struct nlmsghdr *hdr, void *arg)
sd->groups = xmalloc(sd->gsize);
if (!sd->groups) {
- xfree(sd);
+ free(sd);
return -1;
}
memcpy(sd->groups, groups, sd->gsize);
diff --git a/sk-packet.c b/sk-packet.c
index b79a8ec..66a0aad 100644
--- a/sk-packet.c
+++ b/sk-packet.c
@@ -193,11 +193,11 @@ static int dump_one_packet_fd(int lfd, u32 id, const struct fd_parms *p)
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_PACKETSK), &psk, PB_PACKET_SOCK);
out:
release_skopts(&skopts);
- xfree(psk.rx_ring);
- xfree(psk.tx_ring);
+ free(psk.rx_ring);
+ free(psk.tx_ring);
for (i = 0; i < psk.n_mclist; i++)
- xfree(psk.mclist[i]->addr.data);
- xfree(psk.mclist);
+ free(psk.mclist[i]->addr.data);
+ free(psk.mclist);
return ret;
}
@@ -294,9 +294,9 @@ int packet_receive_one(struct nlmsghdr *hdr, void *arg)
return sk_collect_one(m->pdiag_ino, PF_PACKET, &sd->sd);
err:
- xfree(sd->tx);
- xfree(sd->rx);
- xfree(sd);
+ free(sd->tx);
+ free(sd->rx);
+ free(sd);
return -1;
}
diff --git a/sk-queue.c b/sk-queue.c
index 6a39c4b..2ea8f27 100644
--- a/sk-queue.c
+++ b/sk-queue.c
@@ -65,7 +65,7 @@ int read_sk_queues(void)
lseek(img_raw_fd(img), pkt->entry->length, SEEK_CUR);
}
close_image(img);
- xfree(pkt);
+ free(pkt);
return ret;
}
@@ -175,7 +175,7 @@ err_set_sock:
ret = -1;
}
err_brk:
- xfree(data);
+ free(data);
return ret;
}
@@ -224,16 +224,16 @@ int restore_sk_queue(int fd, unsigned int peer_id)
if (lseek(img_raw_fd(img), pkt->img_off, SEEK_SET) == -1) {
pr_perror("lseek() failed");
- xfree(buf);
+ free(buf);
goto err;
}
if (read_img_buf(img, buf, entry->length) != 1) {
- xfree(buf);
+ free(buf);
goto err;
}
ret = write(fd, buf, entry->length);
- xfree(buf);
+ free(buf);
if (ret < 0) {
pr_perror("Failed to send packet");
goto err;
@@ -245,7 +245,7 @@ int restore_sk_queue(int fd, unsigned int peer_id)
}
list_del(&pkt->list);
sk_packet_entry__free_unpacked(entry, NULL);
- xfree(pkt);
+ free(pkt);
}
close_image(img);
diff --git a/sk-tcp.c b/sk-tcp.c
index 9f3bf0d..d60b667 100644
--- a/sk-tcp.c
+++ b/sk-tcp.c
@@ -263,7 +263,7 @@ err_buf:
err_recv:
pr_perror("\trecv failed (%d, want %d, errno %d)", ret, len, errno);
- xfree(buf);
+ free(buf);
goto err_buf;
}
@@ -403,9 +403,9 @@ err_iw:
close_image(img);
err_img:
err_opt:
- xfree(out_buf);
+ free(out_buf);
err_out:
- xfree(in_buf);
+ free(in_buf);
err_in:
return ret;
}
@@ -491,7 +491,7 @@ static int __send_tcp_queue(int sk, int queue, u32 len, struct cr_img *img)
err = 0;
err:
- xfree(buf);
+ free(buf);
return err;
}
diff --git a/sk-unix.c b/sk-unix.c
index c94d0ec..7e191e6 100644
--- a/sk-unix.c
+++ b/sk-unix.c
@@ -169,7 +169,7 @@ static int write_unix_entry(struct unix_sk_desc *sk)
show_one_unix_img("Dumped", sk->ue);
release_skopts(sk->ue->opts);
- xfree(sk->ue);
+ free(sk->ue);
sk->ue = NULL;
@@ -462,7 +462,7 @@ dump:
err:
release_skopts(skopts);
- xfree(ue);
+ free(ue);
return -1;
}
@@ -556,7 +556,7 @@ static int unix_process_name(struct unix_sk_desc *d, const struct unix_diag_msg
* just drop his name, since no one will access
* it via one.
*/
- xfree(name);
+ free(name);
len = 0;
name = NULL;
}
@@ -572,7 +572,7 @@ postprone:
return 0;
out:
- xfree(name);
+ free(name);
return ret;
skip:
ret = 1;
@@ -664,9 +664,9 @@ static int unix_collect_one(const struct unix_diag_msg *m,
err:
ret = -1;
skip:
- xfree(d->icons);
- xfree(d->name);
- xfree(d);
+ free(d->icons);
+ free(d->name);
+ free(d);
return ret;
}
diff --git a/sockets.c b/sockets.c
index 40e59a1..ab2a60e 100644
--- a/sockets.c
+++ b/sockets.c
@@ -290,19 +290,19 @@ static int dump_socket_filter(int sk, SkOptsEntry *soe)
ret = getsockopt(sk, SOL_SOCKET, SO_GET_FILTER, flt, &len);
if (ret) {
pr_perror("Can't get socket filter");
- xfree(flt);
+ free(flt);
return ret;
}
soe->so_filter = xmalloc(len * sizeof(*soe->so_filter));
if (!soe->so_filter) {
- xfree(flt);
+ free(flt);
return -1;
}
encode_filter(flt, soe->so_filter, len);
soe->n_so_filter = len;
- xfree(flt);
+ free(flt);
return 0;
}
@@ -322,7 +322,7 @@ static int restore_socket_filter(int sk, SkOptsEntry *soe)
decode_filter(soe->so_filter, sfp.filter, sfp.len);
ret = restore_opt(sk, SOL_SOCKET, SO_ATTACH_FILTER, &sfp);
- xfree(sfp.filter);
+ free(sfp.filter);
return ret;
}
@@ -543,8 +543,8 @@ int dump_socket_opts(int sk, SkOptsEntry *soe)
void release_skopts(SkOptsEntry *soe)
{
- xfree(soe->so_filter);
- xfree(soe->so_bound_dev);
+ free(soe->so_filter);
+ free(soe->so_bound_dev);
}
int dump_socket(struct fd_parms *p, int lfd, struct cr_img *img)
diff --git a/sysctl.c b/sysctl.c
index 489c599..622fba3 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -331,11 +331,11 @@ out:
close_safe(&fds[i]);
}
- xfree(fds);
+ free(fds);
}
if (reqs)
- xfree(reqs);
+ free(reqs);
close_safe(&dir);
diff --git a/sysfs_parse.c b/sysfs_parse.c
index 93b527d..55df95d 100644
--- a/sysfs_parse.c
+++ b/sysfs_parse.c
@@ -316,9 +316,9 @@ void free_aufs_branches(void)
if (aufs_branches) {
for (n = 0; aufs_branches[n] != NULL; n++)
- xfree(aufs_branches[n]);
+ free(aufs_branches[n]);
- xfree(aufs_branches);
+ free(aufs_branches);
aufs_branches = NULL;
}
diff --git a/tty.c b/tty.c
index 63a6ba2..ed60765 100644
--- a/tty.c
+++ b/tty.c
@@ -466,8 +466,8 @@ static struct reg_file_info *pty_alloc_fake_reg(struct tty_info *info, int subty
static void pty_free_fake_reg(struct reg_file_info **r)
{
if (*r) {
- xfree((*r)->rfe->name);
- xfree((*r));
+ free((*r)->rfe->name);
+ free((*r));
*r = NULL;
}
}
@@ -1408,7 +1408,7 @@ int dump_verify_tty_sids(void)
}
}
}
- xfree(dinfo);
+ free(dinfo);
}
return ret;
@@ -1521,8 +1521,8 @@ static int dump_tty_info(int lfd, u32 id, const struct fd_parms *p, struct tty_d
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_TTY_INFO), &info, PB_TTY_INFO);
out:
- xfree(termios.c_cc);
- xfree(termios_locked.c_cc);
+ free(termios.c_cc);
+ free(termios_locked.c_cc);
return ret;
}
diff --git a/tun.c b/tun.c
index 14012f2..ea0ed26 100644
--- a/tun.c
+++ b/tun.c
@@ -162,7 +162,7 @@ static struct tun_link *__dump_tun_link_fd(int fd, char *name, unsigned flags)
return tl;
err:
- xfree(tl);
+ free(tl);
return NULL;
}
diff --git a/util.c b/util.c
index 337b0ed..18a5d38 100644
--- a/util.c
+++ b/util.c
@@ -822,8 +822,8 @@ void split(char *str, char token, char ***out, int *n)
if (!(*out)[i]) {
int j;
for (j = 0; j < i; j++)
- xfree((*out)[j]);
- xfree(*out);
+ free((*out)[j]);
+ free(*out);
*out = NULL;
*n = -1;
return;
diff --git a/vdso.c b/vdso.c
index 1524d47..2973f89 100644
--- a/vdso.c
+++ b/vdso.c
@@ -179,14 +179,14 @@ int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,
pr_debug("vdso: Droppping marked vdso at %lx\n",
(long)proxy_vdso_marked->e->start);
list_del(&proxy_vdso_marked->list);
- xfree(proxy_vdso_marked);
+ free(proxy_vdso_marked);
vma_area_list->nr--;
if (proxy_vvar_marked) {
pr_debug("vdso: Droppping marked vvar at %lx\n",
(long)proxy_vvar_marked->e->start);
list_del(&proxy_vvar_marked->list);
- xfree(proxy_vvar_marked);
+ free(proxy_vvar_marked);
vma_area_list->nr--;
}
}
--
2.4.3
More information about the CRIU
mailing list