summaryrefslogtreecommitdiffstats
path: root/source/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-05-01 19:43:50 +0000
committerJeremy Allison <jra@samba.org>2000-05-01 19:43:50 +0000
commit3b25f7368be3877e9ad27498bc9451ec88d4b07f (patch)
tree730133b3ce701f5ef5a81d1060eccd5f27468115 /source/utils
parentc40e0a5d3bfa11cb3699bdba1ded91515cabaf5d (diff)
downloadsamba-3b25f7368be3877e9ad27498bc9451ec88d4b07f.tar.gz
samba-3b25f7368be3877e9ad27498bc9451ec88d4b07f.tar.xz
samba-3b25f7368be3877e9ad27498bc9451ec88d4b07f.zip
locking/posix.c: Fixed double-free nasty crash bug found by insure.
utils/make_smbcodepage.c: utils/make_unicodemap.c: Insure 'make install' fixes. Jeremy.
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/make_smbcodepage.c4
-rw-r--r--source/utils/make_unicodemap.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/source/utils/make_smbcodepage.c b/source/utils/make_smbcodepage.c
index f0b68a7baea..1bd3edc2631 100644
--- a/source/utils/make_smbcodepage.c
+++ b/source/utils/make_smbcodepage.c
@@ -167,6 +167,7 @@ static int do_compile(int codepage, char *input_file, char *output_file)
FILE *fp = NULL;
size_t size = 0;
char *buf = NULL;
+ char *orig_buf = NULL;
char output_buf[CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES];
int num_lines = 0;
int i = 0;
@@ -223,6 +224,8 @@ The maximum size I will believe is 100k.\n", prog_name, size);
num_lines = clean_data( &buf, &size);
+ orig_buf = buf; /* Save for free(). */
+
/* There can be a maximum of MAXCODEPAGELINES lines. */
if(num_lines > MAXCODEPAGELINES)
{
@@ -300,6 +303,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
fclose(fp);
+ free(orig_buf);
return 0;
}
diff --git a/source/utils/make_unicodemap.c b/source/utils/make_unicodemap.c
index 76c49361bec..ff9bb19b6fe 100644
--- a/source/utils/make_unicodemap.c
+++ b/source/utils/make_unicodemap.c
@@ -139,6 +139,7 @@ static int do_compile(const char *codepage, const char *input_file, const char *
size_t size = 0;
size_t offset = 0;
char *buf = NULL;
+ char *orig_buf = NULL;
char *output_buf = NULL;
uint16 cp_to_ucs2[65536];
uint16 ucs2_to_cp[65536];
@@ -186,6 +187,8 @@ static int do_compile(const char *codepage, const char *input_file, const char *
num_lines = clean_data( &buf, &size);
+ orig_buf = buf; /* Store for free(). */
+
/*
* Initialize the output data.
*/
@@ -285,7 +288,9 @@ static int do_compile(const char *codepage, const char *input_file, const char *
}
fclose(fp);
-
+
+ free(orig_buf);
+ free(output_buf);
return 0;
}