summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.c
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-04-22 15:37:09 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-04-22 15:37:09 +0000
commita827c5eab32a43ade5551259ea56a6a1af7e861b (patch)
treee6707df68f72baa8645210ba931272285116ad85 /libglusterfs/src/dict.c
parent46d333783a968ab39e0beade9c7a1eec8035f8b1 (diff)
parent99bfc2a2a1689da1e173cb2f8ef54d2b09ef3a5d (diff)
Merge branch 'upstream'
Conflicts: glusterfs.spec.in xlators/mgmt/glusterd/src/Makefile.am xlators/mgmt/glusterd/src/glusterd-utils.c xlators/mgmt/glusterd/src/glusterd.h Change-Id: I27bdcf42b003cfc42d6ad981bd2bf8180176806d
Diffstat (limited to 'libglusterfs/src/dict.c')
-rw-r--r--libglusterfs/src/dict.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 7bc5d57b0..1bed8bf9b 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -2067,6 +2067,23 @@ err:
}
int
+dict_set_dynstr_with_alloc (dict_t *this, char *key, const char *str)
+{
+ char *alloc_str = NULL;
+ int ret = -1;
+
+ alloc_str = gf_strdup (str);
+ if (!alloc_str)
+ return -1;
+
+ ret = dict_set_dynstr (this, key, alloc_str);
+ if (ret)
+ GF_FREE (alloc_str);
+
+ return ret;
+}
+
+int
dict_set_dynstr (dict_t *this, char *key, char *str)
{
data_t * data = NULL;