To pool or to free?
There's an inconsistency here: VALUE_TYPE_VARCHAR and VALUE_TYPE_VARBINARY are using different allocation methods.
You should either be pooling:
+                return NValue::getTempStringValue(value.c_str(), value.length());
+                return NValue::getTempBInaryValue(value.c_str(), value.length());
or calling explicit NValue::free when done with:
+                return getStringValue(value.c_str(), value.length());
+                return getBinaryValue(value);