summaryrefslogtreecommitdiff
path: root/src/mongo/db/field_ref.cpp
diff options
context:
space:
mode:
authorAlberto Lerner <alerner@10gen.com>2013-05-06 10:46:42 -0400
committerAlberto Lerner <alerner@10gen.com>2013-05-06 10:48:15 -0400
commit10c5bd34f4973aae49e6f89fcb939f9b9e9318a7 (patch)
tree0c7abfa6776e855638b01536338e4ac36c5096d5 /src/mongo/db/field_ref.cpp
parentc18c7b22d8709dc63498eb38af0d6eda2d337de6 (diff)
downloadmongo-10c5bd34f4973aae49e6f89fcb939f9b9e9318a7.tar.gz
SERVER-7172 Allow init() to be called more than once in field parsing (for reuse).
Diffstat (limited to 'src/mongo/db/field_ref.cpp')
-rw-r--r--src/mongo/db/field_ref.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/field_ref.cpp b/src/mongo/db/field_ref.cpp
index 8c74b478312..c3dbc47ed5d 100644
--- a/src/mongo/db/field_ref.cpp
+++ b/src/mongo/db/field_ref.cpp
@@ -25,6 +25,10 @@ namespace mongo {
return;
}
+ if (_size != 0) {
+ clear();
+ }
+
// We guarantee that accesses through getPart() will be valid while 'this' is. So we
// take a copy. We're going to be "chopping" up the copy into c-strings.
_fieldBase.reset(new char[dottedField.size()+1]);