]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
fixup! modules/http DoH: allocate req.qsource on req.pool
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 8 Apr 2019 15:55:37 +0000 (17:55 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 11 Apr 2019 07:12:50 +0000 (09:12 +0200)
modules/http/http_doh.lua

index e7a8f2a860bb9988d12c30763a425a2dd29cd2d5..fb4283ae1e1553e4f4dbf85335adbadf87c24732 100644 (file)
@@ -9,8 +9,11 @@ local function get_http_ttl(pkt)
 end
 
 local function convert_sockaddr(pool, family, ipaddr, port)
-       local res = ffi.C.kr_straddr_socket(ipaddr, port, pool) -- resilient to bad parameters
-       if not (family and ipaddr and port and res ~= nil) then
+       local res = nil
+       if family and ipaddr and port then
+               res = ffi.C.kr_straddr_socket(ipaddr, port, pool)
+       end
+       if not res then
                panic('failed to obtain peer IP address')
        end
        return res