mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-30 05:21:57 +00:00
criu: add cleanup_free attribute
Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
parent
031a8d7905
commit
381d2e88fb
1 changed files with 7 additions and 0 deletions
|
|
@ -388,4 +388,11 @@ extern char *get_legacy_iptables_bin(bool ipv6);
|
|||
extern ssize_t read_all(int fd, void *buf, size_t size);
|
||||
extern ssize_t write_all(int fd, const void *buf, size_t size);
|
||||
|
||||
#define cleanup_free __attribute__ ((cleanup (cleanup_freep)))
|
||||
static inline void cleanup_freep (void *p)
|
||||
{
|
||||
void **pp = (void **) p;
|
||||
free (*pp);
|
||||
}
|
||||
|
||||
#endif /* __CR_UTIL_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue