2007-08-17 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Fri, 17 Aug 2007 23:27:42 +0000 (23:27 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 17 Aug 2007 23:27:42 +0000 (23:27 +0000)
* c-exp.y (parse_number): Memory leak.

gdb/ChangeLog
gdb/c-exp.y

index 3bc24ac..0bd7c85 100644 (file)
@@ -1,5 +1,7 @@
 2007-08-17  Michael Snyder  <msnyder@access-company.com>
 
+       * c-exp.y (parse_number): Memory leak.
+
        * completer.c (location_completer): Must free 'fn_list', except 
        in the one case where it is returned (as 'list').
 
index b67c7e1..6318955 100644 (file)
@@ -1096,9 +1096,13 @@ parse_number (p, len, parsed_float, putithere)
            putithere->typed_val_float.type = 
              builtin_type (current_gdbarch)->builtin_long_double;
          else
-           return ERROR;
+           {
+             free (s);
+             return ERROR;
+           }
        }
 
+      free (s);
       return FLOAT;
     }