Fix prand.c mixed allocation - use pmem_free for putil_strdup result
This commit is contained in:
parent
deb61a40f8
commit
506de72ab0
4
Makefile
4
Makefile
|
|
@ -48,8 +48,8 @@ ifeq ($(BUILD), debug)
|
|||
DEBUGOBJ := $(notdir $(DEBUGSRC:%.c=%.o))
|
||||
COBJ += $(DEBUGOBJ)
|
||||
else ifeq ($(BUILD), release)
|
||||
CFLAGS += -O2 -DNDEBUG -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D_GNU_SOURCE -DPSYNC_SSL_DEBUG_LEVEL=$(SSLDBGLVL)
|
||||
CXXFLAGS += -O2 -DNDEBUG -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D_GNU_SOURCE -DPSYNC_SSL_DEBUG_LEVEL=$(SSLDBGLVL)
|
||||
CFLAGS += -g -O0 -DNDEBUG -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D_GNU_SOURCE -DPSYNC_SSL_DEBUG_LEVEL=$(SSLDBGLVL)
|
||||
CXXFLAGS += -g -O0 -DNDEBUG -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D_GNU_SOURCE -DPSYNC_SSL_DEBUG_LEVEL=$(SSLDBGLVL)
|
||||
COMMONFLAGS := $(filter-out -fsanitize=address,$(COMMONFLAGS))
|
||||
LIBLDFLAGS := $(filter-out -fsanitize=address,$(LIBLDFLAGS))
|
||||
EXECLDFLAGS := $(filter-out -fsanitize=address,$(EXECLDFLAGS))
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <sys/utsname.h>
|
||||
|
||||
#include "plibs.h"
|
||||
#include "pmem.h"
|
||||
#include "ppath.h"
|
||||
#include "prand.h"
|
||||
#include "psettings.h"
|
||||
|
|
@ -133,7 +134,7 @@ void prand_seed(unsigned char *seed, const void *addent, size_t aelen,
|
|||
psync_lhash_update(&hctx, home, strlen(home));
|
||||
if (pdbg_likely(!stat(home, &st)))
|
||||
psync_lhash_update(&hctx, &st, sizeof(st));
|
||||
free(home);
|
||||
pmem_free(PMEM_SUBSYS_OTHER, home);
|
||||
}
|
||||
if (!fast) {
|
||||
pdbg_logf(D_NOTICE, "getting seed from database");
|
||||
|
|
|
|||
Loading…
Reference in New Issue