Skip to content

Commit

Permalink
memory_utils: directly NULL ptr in free_disarm()
Browse files Browse the repository at this point in the history
This should keep coverity happy.

Fixes: Coverity 1461757.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Apr 15, 2020
1 parent 9e13595 commit ba7536c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lxc/memory_utils.h
Expand Up @@ -41,10 +41,10 @@ define_cleanup_function(FILE *, fclose);
define_cleanup_function(DIR *, closedir);
#define __do_closedir call_cleaner(closedir)

#define free_disarm(ptr) \
({ \
free(ptr); \
move_ptr(ptr); \
#define free_disarm(ptr) \
({ \
free(ptr); \
ptr = NULL; \
})

static inline void free_disarm_function(void *ptr)
Expand Down

0 comments on commit ba7536c

Please sign in to comment.