Print this page
10075 make usr/src/tools smatch clean

@@ -22,10 +22,12 @@
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
  * Copyright 2015 PALO, Richard
+ *
+ * Copyright (c) 2018, Joyent, Inc.
  */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

@@ -74,10 +76,11 @@
         e->symsrc = NULL;
         e->file_type = DIR_T;
 
         while ((e->arch = assign_arch(arch)) == 0) {
                 if ((arch = strtok(NULL, FS)) == NULL) {
+                        free(e);
                         return (0);
                 }
         }
 
         (void) strcpy(e->name, name);