projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3816248
)
Plugged some small memory leaks
author
John Darrington
<john@darrington.wattle.id.au>
Tue, 14 Nov 2006 11:47:17 +0000
(11:47 +0000)
committer
John Darrington
<john@darrington.wattle.id.au>
Tue, 14 Nov 2006 11:47:17 +0000
(11:47 +0000)
src/data/file-name.c
patch
|
blob
|
history
src/data/format.c
patch
|
blob
|
history
src/libpspp/pool.c
patch
|
blob
|
history
src/ui/flexifile.c
patch
|
blob
|
history
src/ui/terminal/main.c
patch
|
blob
|
history
src/ui/terminal/read-line.c
patch
|
blob
|
history
diff --git
a/src/data/file-name.c
b/src/data/file-name.c
index 3216ef09fb98d155137510f31f683deb9152adf9..97d75e48175b49a9d35d5f9195b8cc3e0743a8ca 100644
(file)
--- a/
src/data/file-name.c
+++ b/
src/data/file-name.c
@@
-146,7
+146,7
@@
fn_tilde_expand (const char *input)
pwd = getpwnam (ds_cstr (&user_name));
if (pwd != NULL && pwd->pw_dir[0] != '\0')
{
pwd = getpwnam (ds_cstr (&user_name));
if (pwd != NULL && pwd->pw_dir[0] != '\0')
{
- home =
pwd->pw_dir
;
+ home =
xstrdup (pwd->pw_dir)
;
remainder = input + 1 + ds_length (&user_name);
}
ds_destroy (&user_name);
remainder = input + 1 + ds_length (&user_name);
}
ds_destroy (&user_name);
diff --git
a/src/data/format.c
b/src/data/format.c
index 06042d0e7009d67f9cc1f61d307521b524eb9905..e236aa310019030b29c4e0aafaedaef300eff894 100644
(file)
--- a/
src/data/format.c
+++ b/
src/data/format.c
@@
-60,10
+60,15
@@
fmt_init (void)
}
}
}
}
+static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
+
/* Deinitialize the format module. */
void
fmt_done (void)
{
/* Deinitialize the format module. */
void
fmt_done (void)
{
+ int t;
+ for (t = 0 ; t < FMT_NUMBER_OF_FORMATS ; ++t )
+ fmt_number_style_destroy (styles[t]);
}
/* Returns an input format specification with type TYPE, width W,
}
/* Returns an input format specification with type TYPE, width W,
@@
-745,7
+750,6
@@
max_digits_for_bytes (int bytes)
return map[bytes - 1];
}
\f
return map[bytes - 1];
}
\f
-static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
/* Creates and returns a new struct fmt_number_style,
initializing all affixes to empty strings. */
/* Creates and returns a new struct fmt_number_style,
initializing all affixes to empty strings. */
diff --git
a/src/libpspp/pool.c
b/src/libpspp/pool.c
index 213efb9ce7cea0aeaac971eea713b03f74a1ff98..31a57e9fbeffcff245924efb8c6abc253d6a2276 100644
(file)
--- a/
src/libpspp/pool.c
+++ b/
src/libpspp/pool.c
@@
-700,8
+700,8
@@
pool_fopen (struct pool *pool, const char *file_name, const char *mode)
assert (pool && file_name && mode);
f = fopen (file_name, mode);
assert (pool && file_name && mode);
f = fopen (file_name, mode);
- if (f
=
= NULL)
-
return NULL
;
+ if (f
!
= NULL)
+
pool_attach_file (pool, f)
;
return f;
}
return f;
}
diff --git
a/src/ui/flexifile.c
b/src/ui/flexifile.c
index 9ed760b254a7def3c016aa946380fa07e9413552..5d06f87621376c615ce15c42f38fd2723eadb528 100644
(file)
--- a/
src/ui/flexifile.c
+++ b/
src/ui/flexifile.c
@@
-25,6
+25,7
@@
#include <data/casefile.h>
#include <data/casefile-private.h>
#include <data/case.h>
#include <data/casefile.h>
#include <data/casefile-private.h>
#include <data/case.h>
+#include <libpspp/compiler.h>
struct class_flexifile
struct class_flexifile
diff --git
a/src/ui/terminal/main.c
b/src/ui/terminal/main.c
index 0613476b549f88027e431170b18b1c640a2bedac..a99f580d8e613ba987d98f803a2bd3c7530b804d 100644
(file)
--- a/
src/ui/terminal/main.c
+++ b/
src/ui/terminal/main.c
@@
-194,6
+194,7
@@
terminate (bool success)
outp_done ();
msg_ui_done ();
outp_done ();
msg_ui_done ();
+ fmt_done ();
}
exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
}
}
exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
}
diff --git
a/src/ui/terminal/read-line.c
b/src/ui/terminal/read-line.c
index 08f9362355d7ddb8df9d81d807949d592ebfe975..46b53b7008ebfe0a865b1906c8b679f177a9e801 100644
(file)
--- a/
src/ui/terminal/read-line.c
+++ b/
src/ui/terminal/read-line.c
@@
-83,6
+83,8
@@
readln_uninitialize (void)
#if HAVE_READLINE && unix
if (history_file != NULL)
write_history (history_file);
#if HAVE_READLINE && unix
if (history_file != NULL)
write_history (history_file);
+ clear_history ();
+ free (history_file);
#endif
}
#endif
}
@@
-157,7
+159,7
@@
readln_read (struct string *line, enum getl_prompt_style style)
#endif
}
#endif
}
-#if
def
HAVE_READLINE
+#if HAVE_READLINE
static char *command_generator (const char *text, int state);
/* Returns a set of command name completions for TEXT.
static char *command_generator (const char *text, int state);
/* Returns a set of command name completions for TEXT.