X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Foutput%2Fpivot-table.c;h=ad95d71fdb04d1c7f6d3950be6145cb374105a2b;hb=2720633be76a46488e05bb9a0d45f24a89375065;hp=3d76ea2afa93ce79f88667380ce789641280757b;hpb=3b03678858485b01277d7488323613fb28691834;p=pspp diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 3d76ea2afa..ad95d71fdb 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -148,7 +148,10 @@ default_look (const struct pivot_table_look *new) { char *error = pivot_table_look_read ("default.stt", &look); if (error) - look = pivot_table_look_ref (pivot_table_look_builtin_default ()); + { + free (error); + look = pivot_table_look_ref (pivot_table_look_builtin_default ()); + } } return look; } @@ -175,10 +178,11 @@ pivot_table_look_read (const char *name, struct pivot_table_look **lookp) size_t n = 0; path[n++] = "."; const char *home = getenv ("HOME"); + char *allocated = NULL; if (home != NULL) - path[n++] = xasprintf ("%s/.pspp/looks", home); - char *allocated; - path[n++] = relocate2 (PKGDATADIR "/looks", &allocated); + path[n++] = allocated = xasprintf ("%s/.pspp/looks", home); + char *allocated2; + path[n++] = relocate2 (PKGDATADIR "/looks", &allocated2); path[n++] = NULL; /* Search path. */ @@ -190,6 +194,7 @@ pivot_table_look_read (const char *name, struct pivot_table_look **lookp) free (name2); } free (allocated); + free (allocated2); if (!file) return xasprintf ("%s: not found", name);