Kaynağa Gözat

Free up any allocated options if we fail

tags/v0.9.3
Michael Brown 18 yıl önce
ebeveyn
işleme
6a0b4c9772
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8
    0
      src/net/udp/dhcp.c

+ 8
- 0
src/net/udp/dhcp.c Dosyayı Görüntüle

@@ -476,6 +476,14 @@ udp_to_dhcp ( struct udp_connection *conn ) {
476 476
  * @v rc		Return status code
477 477
  */
478 478
 static void dhcp_done ( struct dhcp_session *dhcp, int rc ) {
479
+	/* Free up options if we failed */
480
+	if ( rc != 0 ) {
481
+		if ( dhcp->options ) {
482
+			free_dhcp_options ( dhcp->options );
483
+			dhcp->options = NULL;
484
+		}
485
+	}
486
+
479 487
 	/* Mark async operation as complete */
480 488
 	async_done ( &dhcp->aop, rc );
481 489
 }

Loading…
İptal
Kaydet