summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/format.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/format.c b/src/format.c
index e26a865..d75ae5c 100644
--- a/src/format.c
+++ b/src/format.c
@@ -274,6 +274,7 @@ format_add_bv_list(struct berval ***bvlist, const struct berval *bv)
if (list[i]->bv_val != NULL) {
list[i]->bv_len = bv->bv_len;
list[i + 1] = NULL;
+ free(*bvlist);
*bvlist = list;
} else {
free(list[i]);
@@ -1709,11 +1710,15 @@ format_expand_simple(struct plugin_state *state,
* */
format_add_choice(outbuf_choices,
outbuf, values);
+ free(expr);
format_free_bv_list(values);
return 0;
}
}
} else {
+ if (values != NULL) {
+ format_free_bv_list(values);
+ }
/* There's a suitable single value available. */
if (alternate_value != NULL) {
/* Supply the alternate value. */
@@ -2186,6 +2191,8 @@ format_get_data_set(struct plugin_state *state, Slapi_Entry *e,
ret = NULL;
*data_lengths = NULL;
}
+ format_free_choices(choices);
+ free(template);
return ret;
}