diff options
author | Simo Sorce <simo@redhat.com> | 2012-11-14 13:01:15 +0000 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-11-28 13:36:12 +0100 |
commit | df24b52d8b809ab47f89221bed247e13281ca20a (patch) | |
tree | 7bfd4069edb645a7f9dcdc0e3a09c782cc5b0779 /src | |
parent | 701012f04b239793e56b8b0540531b61a6873277 (diff) | |
download | sssd-df24b52d8b809ab47f89221bed247e13281ca20a.tar.gz sssd-df24b52d8b809ab47f89221bed247e13281ca20a.tar.xz sssd-df24b52d8b809ab47f89221bed247e13281ca20a.zip |
Avoid const warnings when deallocating memory
In some case we allocate and assign data to a const pointer.
When we then try to free it we would get a const warning because talloc_free
accepts a void, not a const void pointer. Use discard_const to avoid the
warning, it is safe in this case.
Diffstat (limited to 'src')
-rw-r--r-- | src/util/util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/util.h b/src/util/util.h index 64ad02571..c15ca6683 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -231,7 +231,7 @@ errno_t set_debug_file_from_fd(const int fd); #define FLAGS_PID_FILE 0x0004 #ifndef talloc_zfree -#define talloc_zfree(ptr) do { talloc_free(ptr); ptr = NULL; } while(0) +#define talloc_zfree(ptr) do { talloc_free(discard_const(ptr)); ptr = NULL; } while(0) #endif #ifndef discard_const_p |