Skip to content

Commit

Permalink
fix mem mismatch PHP-189
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Jan 5, 2011
1 parent 3da2129 commit e2e596f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mongo.c
Expand Up @@ -1990,8 +1990,13 @@ static mongo_server* find_or_make_server(char *host, mongo_link *link TSRMLS_DC)
// add this to the hosts list
if (link->rs && link->server_set->hosts) {
zval *null_p;
null_p = (zval*)malloc(sizeof(zval));
INIT_PZVAL(null_p);
if (link->persist) {
null_p = (zval*)malloc(sizeof(zval));
INIT_PZVAL(null_p);
}
else {
MAKE_STD_ZVAL(null_p);
}
Z_TYPE_P(null_p) = IS_NULL;

zend_hash_add(link->server_set->hosts, server->label, strlen(server->label)+1,
Expand Down

0 comments on commit e2e596f

Please sign in to comment.