]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/stabs.c
Replace "if (x) free (x)" with "free (x)", binutils
[thirdparty/binutils-gdb.git] / binutils / stabs.c
index 7cd782d4db6199712fe03fea042b2524720b86b1..9f043d1191bb317d7303ad6e3b70b865f192da52 100644 (file)
@@ -2119,8 +2119,7 @@ parse_stab_struct_type (void *                dhandle,
       || ! parse_stab_tilde_field (dhandle, info, pp, typenums, &vptrbase,
                                   &ownvptr, p_end))
     {
-      if (fields != NULL)
-       free (fields);
+      free (fields);
       return DEBUG_TYPE_NULL;
     }
 
@@ -2955,12 +2954,9 @@ parse_stab_members (void *                dhandle,
   return TRUE;
 
  fail:
-  if (name != NULL)
-    free (name);
-  if (variants != NULL)
-    free (variants);
-  if (argtypes != NULL)
-    free (argtypes);
+  free (name);
+  free (variants);
+  free (argtypes);
   return FALSE;
 }
 
@@ -3901,8 +3897,7 @@ stab_demangle_argtypes (void *dhandle, struct stab_handle *info,
   return minfo.args;
 
  error_return:
-  if (minfo.typestrings != NULL)
-    free (minfo.typestrings);
+  free (minfo.typestrings);
   return NULL;
 }
 
@@ -4516,8 +4511,7 @@ stab_demangle_template (struct stab_demangle_info *minfo, const char **pp,
       if (s3 == NULL || s4 == NULL)
        {
          stab_bad_demangle (orig);
-         if (s3 != NULL)
-           free (s3);
+         free (s3);
          return FALSE;
        }