소스 검색

don't crash now that LongLivedPorts can be null

svn:r4923
Roger Dingledine 21 년 전
부모
커밋
780261aa2e
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/common/container.c

+ 1 - 0
src/common/container.c

@@ -149,6 +149,7 @@ int smartlist_isin(const smartlist_t *sl, void *element) {
 
 int smartlist_string_isin(const smartlist_t *sl, const char *element) {
   int i;
+  if (!sl) return 0;
   for (i=0; i < sl->num_used; i++)
     if (strcmp((const char*)sl->list[i],element)==0)
       return 1;