summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/dict.c')
-rw-r--r--libglusterfs/src/dict.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 1198c65b1d4..b5ebe6cea3d 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -1602,6 +1602,8 @@ dict_set_int8 (dict_t *this, char *key, int8_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1645,6 +1647,8 @@ dict_set_int16 (dict_t *this, char *key, int16_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1688,6 +1692,8 @@ dict_set_int32 (dict_t *this, char *key, int32_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1731,6 +1737,8 @@ dict_set_int64 (dict_t *this, char *key, int64_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1774,6 +1782,8 @@ dict_set_uint16 (dict_t *this, char *key, uint16_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1818,6 +1828,8 @@ dict_set_uint32 (dict_t *this, char *key, uint32_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1861,6 +1873,8 @@ dict_set_uint64 (dict_t *this, char *key, uint64_t val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1903,6 +1917,8 @@ dict_set_double (dict_t *this, char *key, double val)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1921,6 +1937,8 @@ dict_set_static_ptr (dict_t *this, char *key, void *ptr)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -1939,6 +1957,8 @@ dict_set_dynptr (dict_t *this, char *key, void *ptr, size_t len)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -2015,6 +2035,8 @@ dict_set_ptr (dict_t *this, char *key, void *ptr)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -2061,6 +2083,8 @@ dict_set_str (dict_t *this, char *key, char *str)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -2096,6 +2120,8 @@ dict_set_dynstr (dict_t *this, char *key, char *str)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -2117,6 +2143,8 @@ dict_set_dynmstr (dict_t *this, char *key, char *str)
}
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -2173,6 +2201,8 @@ dict_set_bin (dict_t *this, char *key, void *ptr, size_t size)
data->is_static = 0;
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;
@@ -2201,6 +2231,8 @@ dict_set_static_bin (dict_t *this, char *key, void *ptr, size_t size)
data->is_static = 1;
ret = dict_set (this, key, data);
+ if (ret < 0)
+ data_destroy (data);
err:
return ret;