Removed all valgrind warning. Thought this error persists and I can not see
[m6w6/libmemcached] / lib / memcached_storage.c
index 484341c842c286ad2dd8fd106cc5ebfe328f70e7..21dc0934595781f541ffc82b1fbbc8605bca68f5 100644 (file)
@@ -35,6 +35,8 @@ static memcached_return memcached_send(memcached_st *ptr,
                         "%s %.*s %x %llu %zu\r\n", verb,
                         (int)key_length, key, flags, 
                         (unsigned long long)expiration, value_length);
+  if (write_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
+    return MEMCACHED_WRITE_FAILURE;
   if ((sent_length= write(ptr->hosts[server_key].fd, buffer, write_length)) == -1)
     return MEMCACHED_WRITE_FAILURE;
   assert(write_length == sent_length);