summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-08-12 11:27:11 -0400
committerRandolph Tan <randolph@10gen.com>2014-08-12 16:08:20 -0400
commit8fab360707f1a88efd821a7b7981ca972a9cad35 (patch)
treedf743aec419304fe7d4f088ef649ceabc6d07472
parentdc9e090dba1f17467520eca13571512c621d503f (diff)
downloadmongo-8fab360707f1a88efd821a7b7981ca972a9cad35.tar.gz
SERVER-13853 Latent resource leak in BatchedCommandResponse::parseBSON
-rw-r--r--src/mongo/s/write_ops/batched_command_response.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/write_ops/batched_command_response.cpp b/src/mongo/s/write_ops/batched_command_response.cpp
index f412f6d59d9..42f2b2f22d3 100644
--- a/src/mongo/s/write_ops/batched_command_response.cpp
+++ b/src/mongo/s/write_ops/batched_command_response.cpp
@@ -170,7 +170,7 @@ namespace mongo {
std::vector<BatchedUpsertDetail*>* tempUpsertDetails = NULL;
fieldState = FieldParser::extract( source, upsertDetails, &tempUpsertDetails, errMsg );
if ( fieldState == FieldParser::FIELD_INVALID ) return false;
- if ( fieldState == FieldParser::FIELD_SET ) _upsertDetails.reset( tempUpsertDetails );
+ _upsertDetails.reset(tempUpsertDetails);
fieldState = FieldParser::extract(source, lastOp, &_lastOp, errMsg);
if (fieldState == FieldParser::FIELD_INVALID) return false;
@@ -183,12 +183,12 @@ namespace mongo {
std::vector<WriteErrorDetail*>* tempErrDetails = NULL;
fieldState = FieldParser::extract(source, writeErrors, &tempErrDetails, errMsg);
if (fieldState == FieldParser::FIELD_INVALID) return false;
- if (fieldState == FieldParser::FIELD_SET) _writeErrorDetails.reset(tempErrDetails);
+ _writeErrorDetails.reset(tempErrDetails);
WCErrorDetail* wcError = NULL;
fieldState = FieldParser::extract(source, writeConcernError, &wcError, errMsg);
if (fieldState == FieldParser::FIELD_INVALID) return false;
- if (fieldState == FieldParser::FIELD_SET) _wcErrDetails.reset(wcError);
+ _wcErrDetails.reset(wcError);
return true;
}