Skip to content

Commit

Permalink
bug fix: conn->primary was not allocated
Browse files Browse the repository at this point in the history
  • Loading branch information
gerald-lindsly committed Dec 29, 2012
1 parent 6c361a4 commit dcc2bff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mongo.c
Expand Up @@ -644,6 +644,7 @@ MONGO_EXPORT int mongo_replica_set_client( mongo *conn ) {

/* Primary found, so return. */
else if( conn->replica_set->primary_connected ) {
conn->primary = bson_malloc( sizeof( mongo_host_port ) );
strncpy( conn->primary->host, node->host, strlen( node->host ) + 1 );
conn->primary->port = node->port;
return MONGO_OK;
Expand Down

0 comments on commit dcc2bff

Please sign in to comment.