Browse Source

Free up any allocated options if we fail

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
6a0b4c9772
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/net/udp/dhcp.c

+ 8
- 0
src/net/udp/dhcp.c View File

476
  * @v rc		Return status code
476
  * @v rc		Return status code
477
  */
477
  */
478
 static void dhcp_done ( struct dhcp_session *dhcp, int rc ) {
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
 	/* Mark async operation as complete */
487
 	/* Mark async operation as complete */
480
 	async_done ( &dhcp->aop, rc );
488
 	async_done ( &dhcp->aop, rc );
481
 }
489
 }

Loading…
Cancel
Save