don't crash now that LongLivedPorts can be null

svn:r4923
This commit is contained in:
Roger Dingledine 2005-09-08 06:47:27 +00:00
parent 8f37357193
commit 780261aa2e

View File

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