projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge trunk
[awesomized/libmemcached]
/
libmemcached
/
string.cc
diff --git
a/libmemcached/string.cc
b/libmemcached/string.cc
index 6f3b9c1c571a4e5e9ccc5685eb59a6bcb35ec3ea..7bc7fec0036e87c293d87b1ee8c31287af515472 100644
(file)
--- a/
libmemcached/string.cc
+++ b/
libmemcached/string.cc
@@
-37,7
+37,6
@@
#include <libmemcached/common.h>
#include <libmemcached/common.h>
-#include <cassert>
inline static memcached_return_t _string_check(memcached_string_st *string, size_t need)
{
inline static memcached_return_t _string_check(memcached_string_st *string, size_t need)
{
@@
-88,7
+87,7
@@
memcached_string_st *memcached_string_create(memcached_st *memc, memcached_strin
{
WATCHPOINT_ASSERT(self->options.is_initialized == false);
{
WATCHPOINT_ASSERT(self->options.is_initialized == false);
-
self->options.is_allocated= false
;
+
memcached_set_allocated(self, false)
;
}
else
{
}
else
{
@@
-99,7
+98,7
@@
memcached_string_st *memcached_string_create(memcached_st *memc, memcached_strin
return NULL;
}
return NULL;
}
-
self->options.is_allocated= true
;
+
memcached_set_allocated(self, true)
;
}
self->root= memc;
}
self->root= memc;
@@
-107,7
+106,10
@@
memcached_string_st *memcached_string_create(memcached_st *memc, memcached_strin
if (memcached_failed(_string_check(self, initial_size)))
{
if (memcached_failed(_string_check(self, initial_size)))
{
- libmemcached_free(memc, self);
+ if (memcached_is_allocated(self))
+ {
+ libmemcached_free(memc, self);
+ }
return NULL;
}
return NULL;
}
@@
-228,7
+230,7
@@
const char *memcached_string_value(const memcached_string_st *self)
char *memcached_string_take_value(memcached_string_st *self)
{
char *memcached_string_take_value(memcached_string_st *self)
{
- assert
(self
);
+ assert
_msg(self, "Invalid memcached_string_st"
);
// If we fail at adding the null, we copy and move on
if (memcached_success(memcached_string_append_null(self)))
{
// If we fail at adding the null, we copy and move on
if (memcached_success(memcached_string_append_null(self)))
{