summaryrefslogtreecommitdiff
path: root/source3/utils/make_smbcodepage.c
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
commit830a9e571eee5330097376e94af7dc0f2d5f2f02 (patch)
tree7ed942dfbf735b7ad5e16837f79ca6930ddf2fcf /source3/utils/make_smbcodepage.c
parent5fb473fc758b5fbc1145c00dc9b95567107afd5c (diff)
downloadsamba-830a9e571eee5330097376e94af7dc0f2d5f2f02.tar.gz
samba-830a9e571eee5330097376e94af7dc0f2d5f2f02.tar.bz2
samba-830a9e571eee5330097376e94af7dc0f2d5f2f02.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. (This used to be commit 3b25f7368be3877e9ad27498bc9451ec88d4b07f)
Diffstat (limited to 'source3/utils/make_smbcodepage.c')
-rw-r--r--source3/utils/make_smbcodepage.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/utils/make_smbcodepage.c b/source3/utils/make_smbcodepage.c
index f0b68a7bae..1bd3edc263 100644
--- a/source3/utils/make_smbcodepage.c
+++ b/source3/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;
}