ia64/xen-unstable

changeset 14051:2414007d92ba

Fix allocation of the error_description fields.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Feb 21 00:04:06 2007 +0000 (2007-02-21)
parents df08fe145d24
children 2840b5e7f585
files tools/libxen/src/xen_common.c
line diff
     1.1 --- a/tools/libxen/src/xen_common.c	Tue Feb 20 23:59:13 2007 +0000
     1.2 +++ b/tools/libxen/src/xen_common.c	Wed Feb 21 00:04:06 2007 +0000
     1.3 @@ -989,10 +989,10 @@ static void parse_failure(xen_session *s
     1.4          char **c = (char **)error_descriptions->contents;
     1.5          int n = error_descriptions->size;
     1.6  
     1.7 -        char **strings = malloc(3 * sizeof(char *));
     1.8 +        char **strings = malloc(n * sizeof(char *));
     1.9          for (int i = 0; i < n; i++)
    1.10          {
    1.11 -            strings[i] = xen_strdup_(c[i]);
    1.12 +            strings[i] = c[i];
    1.13          }
    1.14  
    1.15          session->error_description_count = n;