summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd9863d)
raw | patch | inline | side by side (parent: bd9863d)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 2 Jan 2015 11:33:50 +0000 (12:33 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 2 Jan 2015 11:33:50 +0000 (12:33 +0100) |
src/core/data.c | patch | blob | history |
diff --git a/src/core/data.c b/src/core/data.c
index 2665165a0970e98075a702bbea020e3803e35cab..8c54c9390842f0014df803009af11358fe6fbc76 100644 (file)
--- a/src/core/data.c
+++ b/src/core/data.c
v[i] = NULL;
}
}
+ else if (type == SDB_TYPE_BINARY) {
+ struct {
+ size_t length;
+ unsigned char *datum;
+ } *v = datum->data.array.values;
+ size_t i;
+
+ for (i = 0; i < datum->data.array.length; ++i) {
+ if (v[i].datum)
+ free(v[i].datum);
+ v[i].datum = NULL;
+ }
+ }
+ else if (type == SDB_TYPE_REGEX) {
+ struct {
+ char *raw;
+ regex_t regex;
+ } *v = datum->data.array.values;
+ size_t i;
+
+ for (i = 0; i < datum->data.array.length; ++i) {
+ if (v[i].raw) {
+ free(v[i].raw);
+ regfree(&v[i].regex);
+ }
+ v[i].raw = NULL;
+ }
+ }
} /* free_array_values */
/* compare two arrays element-by-element returning how the first non-equal