From cae7d3e1cb34242712556894c8770e47ca20fa16 Mon Sep 17 00:00:00 2001 From: Ivan Polyakov Date: Sun, 2 Oct 2022 22:47:45 +0300 Subject: [PATCH] Fixed unallocated pointer freeing, added "examples" target in root Makefile --- Makefile | 4 ++++ c/query.c | 3 --- config.mk | 2 +- examples/.gitignore | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 examples/.gitignore diff --git a/Makefile b/Makefile index f3d4547..f71e12c 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ uninstall: rm -f $(PREFIX)/lib/librapidaxx.so* rm -rf $(PREFIX)/include/rapida +#target Examples +examples: all + cd $@ && make + #target Shared C library librapida.so: $(COBJ) $(CC) -shared $^ -o $@ $(LDFLAGS) diff --git a/c/query.c b/c/query.c index a3d83aa..1219e98 100644 --- a/c/query.c +++ b/c/query.c @@ -11,9 +11,6 @@ int rpd_query_parse(rpd_keyval *dest, const char *src) { int len = count_char_entries(src, '='); if (!len) { - if (dest->items) { - free(dest->items); - } dest->items = NULL; dest->capacity = 0; dest->size = 0; diff --git a/config.mk b/config.mk index 7b742a2..98f2e04 100644 --- a/config.mk +++ b/config.mk @@ -1,4 +1,4 @@ -VERSION=0.2.0 +VERSION=0.2.1 #arg Installation prefix PREFIX=/usr/local diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 0000000..806300b --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1,4 @@ +c/* +cxx/* +!c/*.c* +!cxx/*.c*