Merge branch 'fix-uchex-warnings'

There is one more report that is false positive, see [1]:
  "In bufferevent_openssl.c, pointer wm is dereferenced on line 871
before it is null checked on line 873."

  [1]: https://github.com/libevent/libevent/issues/382#issuecomment-238081938

* fix-uchex-warnings:
  evdns: do not check server_req twice
  evrpc: do not check req twice

Fixes: #382
(cherry picked from commit da33f768e451f1b5722b7426e03c87e260ee43d0)
This commit is contained in:
Azat Khuzhin 2019-04-01 02:42:55 +03:00
parent 58e81106ad
commit c010069b0b
No known key found for this signature in database
GPG Key ID: B86086848EF8686D
2 changed files with 6 additions and 9 deletions

12
evdns.c
View File

@ -1299,14 +1299,12 @@ request_parse(u8 *packet, int length, struct evdns_server_port *port, struct soc
return 0;
err:
if (server_req) {
if (server_req->base.questions) {
for (i = 0; i < server_req->base.nquestions; ++i)
mm_free(server_req->base.questions[i]);
mm_free(server_req->base.questions);
}
mm_free(server_req);
if (server_req->base.questions) {
for (i = 0; i < server_req->base.nquestions; ++i)
mm_free(server_req->base.questions[i]);
mm_free(server_req->base.questions);
}
mm_free(server_req);
return -1;
#undef SKIP_NAME

View File

@ -892,8 +892,7 @@ evrpc_reply_done(struct evhttp_request *req, void *arg)
* layer is going to free it. we need to
* request ownership explicitly
*/
if (req != NULL)
evhttp_request_own(req);
evhttp_request_own(req);
evrpc_pause_request(pool, ctx,
evrpc_reply_done_closure);