Print this page
10125 smatch fixes for cmd-inet

@@ -21,11 +21,13 @@
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <errno.h>

@@ -2749,12 +2751,13 @@
 
                 if ((p_section == NULL) || (plist == NULL))
                         return (B_FALSE);
                 pae = plist->ael_head;
                 while (pae != NULL) {
+                        ae_t *next = pae->ae_next;
                         free(pae);
-                        pae = pae->ae_next;
+                        pae = next;
                 }
                 plist->ael_head = plist->ael_tail = NULL;
                 plist->ael_argc = 0;
         } else if (gp_config_file != NULL) {
                 for (i = 0; i < argc; i++) {