X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=binary_storage.c;h=e3d620218cfb3927c8267cf98f2c3246d86497d5;hb=34c0a707db7b6d8099df2a08f580792f7ebaf07e;hp=139f3a04c3504973528824ae49e6335f595519c9;hpb=3f472567bdd9bc3fbfd99b342ee29b25d5b553be;p=rrq%2Ffuse_xattrs.git diff --git a/binary_storage.c b/binary_storage.c index 139f3a0..e3d6202 100644 --- a/binary_storage.c +++ b/binary_storage.c @@ -15,7 +15,7 @@ #include "binary_storage.h" #include "utils.h" -#include "const.h" +#include "fuse_xattrs_config.h" #include @@ -43,8 +43,12 @@ void __print_on_memory_attr(struct on_memory_attr *attr) void __free_on_memory_attr(struct on_memory_attr *attr) { - free(attr->name); - free(attr->value); + if(attr->name != NULL) + free(attr->name); + + if(attr->value != NULL) + free(attr->value); + free(attr); } @@ -131,6 +135,8 @@ struct on_memory_attr *__read_on_memory_attr(size_t *offset, char *buffer, size_ { debug_print("offset=%zu\n", *offset); struct on_memory_attr *attr = malloc(sizeof(struct on_memory_attr)); + attr->name = NULL; + attr->value = NULL; //////////////////////////////// // Read name size