Skip to content

Commit 51ac675

Browse files
committed
PHPC-125: pointer to out of scope variable :]
1 parent ac3984d commit 51ac675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php_phongo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
811811
php_stream *stream = NULL;
812812
const bson_t *options;
813813
bson_iter_t iter;
814+
struct timeval timeout = {0, 0};
814815
struct timeval *timeoutp = NULL;
815816
char *uniqid;
816817
char *errmsg = NULL;
@@ -840,7 +841,6 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
840841
options = mongoc_uri_get_options(uri);
841842

842843
if (bson_iter_init_find (&iter, options, "connecttimeoutms") && BSON_ITER_HOLDS_INT32 (&iter)) {
843-
struct timeval timeout = {0, 0};
844844
int32_t connecttimeoutms = MONGOC_DEFAULT_CONNECTTIMEOUTMS;
845845

846846
if (!(connecttimeoutms = bson_iter_int32(&iter))) {

0 commit comments

Comments
 (0)