diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-07-31 19:56:38 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2015-07-31 19:56:38 +0200 |
commit | 97b11eedff9d2e17101ad453caf9e48b73246719 (patch) | |
tree | add86c36a039f2cbeb8232908c7a0cb3ca784ea5 /src/basic/copy.c | |
parent | bus-proxy: allow empty arguments to UpdateActivationEnvironment() (diff) | |
download | systemd-97b11eedff9d2e17101ad453caf9e48b73246719.tar.xz systemd-97b11eedff9d2e17101ad453caf9e48b73246719.zip |
tree-wide: introduce mfree()
Pretty trivial helper which wraps free() but returns NULL, so we can
simplify this:
free(foobar);
foobar = NULL;
to this:
foobar = mfree(foobar);
Diffstat (limited to 'src/basic/copy.c')
-rw-r--r-- | src/basic/copy.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/basic/copy.c b/src/basic/copy.c index e2d356d676..33427c6a73 100644 --- a/src/basic/copy.c +++ b/src/basic/copy.c @@ -467,8 +467,7 @@ int copy_xattr(int fdf, int fdt) { sza *= 2; - free(bufa); - bufa = NULL; + bufa = mfree(bufa); } p = bufa; @@ -491,8 +490,7 @@ int copy_xattr(int fdf, int fdt) { if (m < 0) { if (errno == ERANGE) { szb *= 2; - free(bufb); - bufb = NULL; + bufb = mfree(bufb); continue; } |