Commits

Jilles Tjoelker  committed cc297d4

Fix a possible crash with SSL connections closing early.
libratbox r25356 (jilles)

  • Participants
  • Parent commits bca588b

Comments (0)

Files changed (1)

File libratbox/src/openssl.c

 	int ssl_err;
 	lrb_assert(F->accept != NULL);
 	int flags;
+	struct acceptdata *ad;
 
 	if(!SSL_is_init_finished((SSL *) F->ssl))
 	{
 	}
 	rb_settimeout(F, 0, NULL, NULL);
 	rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, NULL, NULL);
-                                                                
-	F->accept->callback(F, RB_OK, (struct sockaddr *) &F->accept->S, F->accept->addrlen,
-			    F->accept->data);
-	rb_free(F->accept);
+	
+	ad = F->accept;
 	F->accept = NULL;
+	ad->callback(F, RB_OK, (struct sockaddr *) &ad->S, ad->addrlen,
+			    ad->data);
+	rb_free(ad);
 
 }