chiark / gitweb /
tree-wide: introduce free_and_replace helper
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 16 Oct 2016 23:23:35 +0000 (19:23 -0400)
committerSven Eden <yamakuzure@gmx.net>
Wed, 5 Jul 2017 06:50:55 +0000 (08:50 +0200)
commita0db25e25b5691e4fc0afa5f5a9a8d1ce586decf
treec20e7ac755a6778eff4629885b6307fb093995a4
parent2aebec83237867717ad3ba0096a82670d82d911a
tree-wide: introduce free_and_replace helper

It's a common pattern, so add a helper for it. A macro is necessary
because a function that takes a pointer to a pointer would be type specific,
similarly to cleanup functions. Seems better to use a macro.
coccinelle/free_and_replace.cocci [new file with mode: 0644]
src/basic/alloc-util.h
src/basic/fs-util.c
src/basic/path-util.c