summaryrefslogtreecommitdiff
path: root/src/analysis/db/misc/rlestr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db/misc/rlestr.c')
-rw-r--r--src/analysis/db/misc/rlestr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/analysis/db/misc/rlestr.c b/src/analysis/db/misc/rlestr.c
index f26c146..0fe182b 100644
--- a/src/analysis/db/misc/rlestr.c
+++ b/src/analysis/db/misc/rlestr.c
@@ -105,6 +105,9 @@ void init_static_rle_string(rle_string *str, const char *data)
void dup_into_rle_string(rle_string *str, const char *data)
{
+ if (str->data != NULL)
+ unset_rle_string(str);
+
if (data != NULL)
{
str->data = strdup(data);
@@ -144,6 +147,11 @@ void set_dynamic_rle_string(rle_string *str, char *data)
str->length = strlen(data);
str->dynamic = true;
}
+ else
+ {
+ str->data = NULL;
+ str->length = 0;
+ }
}
@@ -172,6 +180,11 @@ void set_static_rle_string(rle_string *str, const char *data)
str->length = strlen(data);
str->dynamic = false;
}
+ else
+ {
+ str->data = NULL;
+ str->length = 0;
+ }
}