projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
m4: lost cinttypes
[awesomized/libmemcached]
/
libmemcached
/
string.cc
diff --git
a/libmemcached/string.cc
b/libmemcached/string.cc
index ce96b98cba501ef57ff4552ae8045e44d11470ea..b821aca61edcb1de951774d4a81b2ca1f75b19e5 100644
(file)
--- a/
libmemcached/string.cc
+++ b/
libmemcached/string.cc
@@
-281,18
+281,20
@@
char *memcached_string_take_value(memcached_string_st *self)
{
char* value= NULL;
{
char* value= NULL;
- if (memcached_string_length(self))
+ assert_msg(self, "Invalid memcached_string_st");
+ if (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 (memcached_string_length(self))
{
{
- return memcached_string_c_copy(self);
+ // If we fail at adding the null, we copy and move on
+ if (memcached_failed(memcached_string_append_null(self)))
+ {
+ return NULL;
+ }
+
+ value= self->string;
+ _init_string(self);
}
}
-
- value= self->string;
-
- _init_string(self);
}
return value;
}
return value;