Skip to content

Commit

Permalink
Fix tiny memory leak of Server\Port (#3507)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Jul 29, 2020
1 parent 75936f2 commit ee2dc83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions swoole_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void server_free_object(zend_object *object) {
}
for (auto zport : property->ports) {
php_swoole_server_port_deref(Z_OBJ_P(zport));
sw_zval_free(zport);
efree(zport);
}
server_object->serv = nullptr;
}
Expand Down Expand Up @@ -1038,7 +1038,6 @@ static zval *php_swoole_server_add_port(ServerObject *server_object, swListenPor
zval *zserv = (zval *) serv->ptr2;
zval *zports = sw_zend_read_and_convert_property_array(Z_OBJCE_P(zserv), zserv, ZEND_STRL("ports"), 0);
(void) add_next_index_zval(zports, zport);
Z_ADDREF_P(zport);
} while (0);

/* iterator */
Expand Down

0 comments on commit ee2dc83

Please sign in to comment.