소스 검색

transport_new() cannot fail; do not check for it to fail.

(It can't fail because the tor_malloc*() family of functions can
never return NULL)

Found with STACK.
Nick Mathewson 6 년 전
부모
커밋
472473ec5d
1개의 변경된 파일0개의 추가작업 그리고 4개의 파일을 삭제
  1. 0 4
      src/or/transports.c

+ 0 - 4
src/or/transports.c

@@ -1094,8 +1094,6 @@ parse_smethod_line(const char *line, managed_proxy_t *mp)
 
   transport = transport_new(&tor_addr, port, method_name,
                             PROXY_NONE, args_string);
-  if (!transport)
-    goto err;
 
   smartlist_add(mp->transports, transport);
 
@@ -1186,8 +1184,6 @@ parse_cmethod_line(const char *line, managed_proxy_t *mp)
   }
 
   transport = transport_new(&tor_addr, port, method_name, socks_ver, NULL);
-  if (!transport)
-    goto err;
 
   smartlist_add(mp->transports, transport);