[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev [patch] [dev16] FREE not free (in general)
From: |
John Bley |
Subject: |
lynx-dev [patch] [dev16] FREE not free (in general) |
Date: |
Fri, 12 Feb 1999 20:50:26 -0500 (EST) |
Patch against 2.8.2dev.16 for the friendly-happy-safe FREE() to
replace all free()s except one. There's a good reason for that one.
Apologies for a largish patch.
--
John Bley - address@hidden
Duke '99 - English/Computer Science
Since English is a mess, it maps well onto the problem space,
which is also a mess, which we call reality. - Larry Wall
diff -Burp lynx2-8-2/src/GridText.c lynx2-8-2-patched/src/GridText.c
--- lynx2-8-2/src/GridText.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/GridText.c Fri Feb 12 20:41:48 1999
@@ -9072,7 +9072,7 @@ PUBLIC int HText_ExtEditForm ARGS1(
if (stat (tbuf, &stat_info) == 0)
remove (tbuf);
#endif
- free (tbuf);
+ FREE (tbuf);
CTRACE(tfp, "GridText: returned from editor (%s)\n", editor);
@@ -9368,11 +9368,11 @@ PUBLIC int HText_ExtEditForm ARGS1(
CTRACE(tfp, "GridText: struct's adjusted - exiting HText_ExtEditForm()\n");
- free (line);
- free (ebuf);
- free (tbuf);
+ FREE (line);
+ FREE (ebuf);
+ FREE (tbuf);
LYRemoveTemp (ed_temp);
- free (ed_temp);
+ FREE (ed_temp);
/*
* Return the offset needed to move the cursor from its current
diff -Burp lynx2-8-2/src/HTAlert.c lynx2-8-2-patched/src/HTAlert.c
--- lynx2-8-2/src/HTAlert.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/HTAlert.c Fri Feb 12 20:23:39 1999
@@ -504,7 +504,7 @@ PUBLIC BOOL HTConfirmCookie ARGS4(
HTSprintf(&message, ADVANCED_COOKIE_CONFIRMATION,
server, namelen, name, valuelen, value);
_statusline(message);
- free(message);
+ FREE(message);
}
while (1) {
if(!LYAcceptAllCookies) {
diff -Burp lynx2-8-2/src/LYBookmark.c lynx2-8-2-patched/src/LYBookmark.c
--- lynx2-8-2/src/LYBookmark.c Wed Jan 13 06:37:34 1999
+++ lynx2-8-2-patched/src/LYBookmark.c Fri Feb 12 20:23:39 1999
@@ -34,7 +34,7 @@ show_bookmark_not_defined NOARGS
BOOKMARK_FILE_NOT_DEFINED,
key_for_func(LYK_OPTIONS));
LYMBM_statusline(string_buffer);
- free(string_buffer);
+ FREE(string_buffer);
}
/*
@@ -731,7 +731,7 @@ draw_bookmark_choices:
HTSprintf0(&shead_buffer,
MULTIBOOKMARKS_SHEAD_MASK, MBM_current, MBM_screens);
addstr(shead_buffer);
- free(shead_buffer);
+ FREE(shead_buffer);
} else {
addstr(MULTIBOOKMARKS_SHEAD);
}
diff -Burp lynx2-8-2/src/LYForms.c lynx2-8-2-patched/src/LYForms.c
--- lynx2-8-2/src/LYForms.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/LYForms.c Fri Feb 12 20:23:40 1999
@@ -998,7 +998,7 @@ redraw:
char *msg = 0;
HTSprintf0(&msg, OPTION_ALREADY_CURRENT, (number +
1));
HTUserMsg(msg);
- free(msg);
+ FREE(msg);
if (disabled) {
_statusline(FORM_LINK_OPTION_LIST_UNM_MSG);
} else {
diff -Burp lynx2-8-2/src/LYGetFile.c lynx2-8-2-patched/src/LYGetFile.c
--- lynx2-8-2/src/LYGetFile.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/LYGetFile.c Fri Feb 12 20:23:40 1999
@@ -119,7 +119,7 @@ Try_Redirected_URL:
char *msg = 0;
HTSprintf0(&msg, PORT_INVALID, (unsigned long)value);
HTAlert(msg);
- free(msg);
+ FREE(msg);
FREE(temp);
return(NULLFILE);
}
@@ -407,7 +407,7 @@ Try_Redirected_URL:
EXECUTION_DISABLED_FOR_FILE,
key_for_func(LYK_OPTIONS));
HTAlert(buf);
- free(buf);
+ FREE(buf);
}
#else /* no exec_links */
HTUserMsg(EXECUTION_NOT_COMPILED);
@@ -1212,7 +1212,7 @@ PUBLIC BOOLEAN exec_ok ARGS3(
BADCHAR_IN_EXEC_LINK,
*cp);
HTAlert(buf);
- free(buf);
+ FREE(buf);
return FALSE;
}
}
diff -Burp lynx2-8-2/src/LYJump.c lynx2-8-2-patched/src/LYJump.c
--- lynx2-8-2/src/LYJump.c Mon Jan 18 07:29:20 1999
+++ lynx2-8-2-patched/src/LYJump.c Fri Feb 12 20:23:40 1999
@@ -192,7 +192,7 @@ PUBLIC char *LYJump ARGS1(int, key)
char *msg = 0;
HTSprintf0(&msg, KEY_NOT_MAPPED_TO_JUMP_FILE, key);
HTAlert(msg);
- free(msg);
+ FREE(msg);
return NULL;
}
if (!jtp->table)
diff -Burp lynx2-8-2/src/LYLocal.c lynx2-8-2-patched/src/LYLocal.c
--- lynx2-8-2/src/LYLocal.c Sat Dec 26 15:50:01 1998
+++ lynx2-8-2-patched/src/LYLocal.c Fri Feb 12 20:23:40 1999
@@ -285,11 +285,11 @@ PRIVATE BOOLEAN ok_localname ARGS2(char*
if (!ok_stat(s, &dir_info)
|| !ok_file_or_dir(&dir_info)) {
- free(s);
+ FREE(s);
return FALSE;
}
strcpy(dst, s);
- free(s);
+ FREE(s);
return TRUE;
}
@@ -465,7 +465,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
cp = HTfullURL_toFile(cp);
StrAllocCopy(savepath, cp);
}
- free(cp);
+ FREE(cp);
if (!ok_stat(savepath, &dir_info)) {
FREE(savepath);
@@ -713,7 +713,7 @@ PUBLIC BOOLEAN local_modify ARGS2(
if (!HTList_isEmpty(tagged)) {
cp = HTpartURL_toFile(doc->address);
strcpy(testpath, cp);
- free(cp);
+ FREE(cp);
count = modify_tagged(testpath);
@@ -745,7 +745,7 @@ PUBLIC BOOLEAN local_modify ARGS2(
if (strchr("NLP", ans) != NULL) {
cp = HTfullURL_toFile(links[doc->link].lname);
strcpy(testpath, cp);
- free(cp);
+ FREE(cp);
if (ans == 'N') {
return(modify_name(testpath));
@@ -878,7 +878,7 @@ PUBLIC BOOLEAN local_create ARGS1(
cp = HTfullURL_toFile(doc->address);
strcpy(testpath,cp);
- free(cp);
+ FREE(cp);
if (ans == 'F') {
return(create_file(testpath));
@@ -982,7 +982,7 @@ PUBLIC BOOLEAN local_remove ARGS1(
if (is_url(cp) == FILE_URL_TYPE) {
tp = HTfullURL_toFile(cp);
strcpy(testpath, tp);
- free(tp);
+ FREE(tp);
if ((i = strlen(testpath)) && testpath[i - 1] == '/')
testpath[(i - 1)] = '\0';
@@ -1049,7 +1049,7 @@ PRIVATE BOOLEAN permit_location ARGS3(
cp = HTfullURL_toFile(strip_trailing_slash(srcpath));
strcpy(local_src, cp);
- free(cp);
+ FREE(cp);
/*
* A couple of sanity tests.
@@ -1183,7 +1183,7 @@ PRIVATE BOOLEAN permit_location ARGS3(
return(0);
strcpy(tmpdst, destpath); /* operate only on filename */
- free(destpath);
+ FREE(destpath);
destpath = tmpdst;
/*
@@ -1622,7 +1622,7 @@ PUBLIC int dired_options ARGS2(
cp = HTfullURL_toFile(links[doc->link].lname);
strcpy(path, cp);
LYTrimPathSep(path);
- free(cp);
+ FREE(cp);
if (!ok_lstat(path, &dir_info)) {
LYCloseTempFP(fp0);
@@ -1838,7 +1838,7 @@ PUBLIC BOOLEAN local_install ARGS3(
int err;
args[src] = HTfullURL_toFile(name);
err = (LYExecv(INSTALL_PATH, args, tmpbuf) <= 0);
- free(args[src]);
+ FREE(args[src]);
if (err)
return ((count == 0) ? -1 : count);
count++;
diff -Burp lynx2-8-2/src/LYMainLoop.c lynx2-8-2-patched/src/LYMainLoop.c
--- lynx2-8-2/src/LYMainLoop.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/LYMainLoop.c Fri Feb 12 20:23:40 1999
@@ -4196,7 +4196,7 @@ if (!LYUseFormsOptions) {
if (is_url(cp) == FILE_URL_TYPE) {
cp = HTfullURL_toFile(cp);
StrAllocCopy(tp, cp);
- free(cp);
+ FREE(cp);
if (stat(tp, &dir_info) == -1) {
HTAlert(NO_STATUS);
diff -Burp lynx2-8-2/src/LYPrint.c lynx2-8-2-patched/src/LYPrint.c
--- lynx2-8-2/src/LYPrint.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/LYPrint.c Fri Feb 12 20:23:40 1999
@@ -280,7 +280,7 @@ PRIVATE BOOLEAN confirm_by_pages ARGS3(
HTSprintf0(&msg, prompt, pages);
_statusline(msg);
- free(msg);
+ FREE(msg);
c = LYgetch();
#ifdef VMS
diff -Burp lynx2-8-2/src/LYReadCFG.c lynx2-8-2-patched/src/LYReadCFG.c
--- lynx2-8-2/src/LYReadCFG.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/LYReadCFG.c Fri Feb 12 20:23:40 1999
@@ -1040,7 +1040,7 @@ PUBLIC void free_lynx_cfg NOARGS
case CONF_ENV:
if (q->str_value != 0) {
FREE(*(q->str_value));
- free((char *)q->str_value);
+ FREE((char *)q->str_value);
}
break;
default:
diff -Burp lynx2-8-2/src/LYShowInfo.c lynx2-8-2-patched/src/LYShowInfo.c
--- lynx2-8-2/src/LYShowInfo.c Wed Jan 13 06:37:34 1999
+++ lynx2-8-2-patched/src/LYShowInfo.c Fri Feb 12 20:23:40 1999
@@ -153,14 +153,14 @@ PUBLIC int showinfo ARGS4(
s = HTfullURL_toFile(doc->address);
strcpy(temp, s);
- free(s);
+ FREE(s);
fprintf(fp0, " <em>%4s</em> %s\n", gettext("Name:"), temp);
fprintf(fp0, " <em>%4s</em> %s\n", gettext("URL:"), doc->address);
s = HTfullURL_toFile(links[doc->link].lname);
strcpy(temp, s);
- free(s);
+ FREE(s);
if (lstat(temp, &dir_info) == -1) {
CTRACE(tfp, "lstat(%s) failed, errno=%d\n", temp, errno);
diff -Burp lynx2-8-2/src/LYUpload.c lynx2-8-2-patched/src/LYUpload.c
--- lynx2-8-2/src/LYUpload.c Thu Dec 24 06:27:23 1998
+++ lynx2-8-2-patched/src/LYUpload.c Fri Feb 12 20:23:41 1999
@@ -205,7 +205,7 @@ PUBLIC int LYUpload_options ARGS2(
cp = HTfullURL_toFile(directory);
strcpy(curloc,cp);
LYTrimPathSep(curloc);
- free(cp);
+ FREE(cp);
#endif /* VMS */
LYLocalFileToURL(newfile, tempfile);
diff -Burp lynx2-8-2/src/LYUtils.c lynx2-8-2-patched/src/LYUtils.c
--- lynx2-8-2/src/LYUtils.c Mon Feb 8 05:32:59 1999
+++ lynx2-8-2-patched/src/LYUtils.c Fri Feb 12 20:23:41 1999
@@ -1721,7 +1721,7 @@ PUBLIC void free_and_clear ARGS1(
char **, pointer)
{
if (*pointer) {
- free(*pointer);
+ FREE(*pointer);
*pointer = 0;
}
return;
@@ -5422,7 +5422,7 @@ PUBLIC int putenv ARGS1(
new_environ[size] = (char *) string;
new_environ[size + 1] = NULL;
if (last_environ != NULL)
- free ((char *) last_environ);
+ FREE ((char *) last_environ);
last_environ = new_environ;
environ = new_environ;
}
@@ -5494,7 +5494,7 @@ PRIVATE BOOL IsOurFile ARGS1(char *, nam
break;
}
} while (leaf != path);
- free(path);
+ FREE(path);
#endif
return !linked;
}
@@ -5847,8 +5847,8 @@ PUBLIC void LYRemoveTemp ARGS1(
CTRACE_FLUSH(tfp);
if (p->file != 0)
fclose(p->file);
- free(p->name);
- free(p);
+ FREE(p->name);
+ FREE(p);
break;
}
}
diff -Burp lynx2-8-2/src/UCAuto.c lynx2-8-2-patched/src/UCAuto.c
--- lynx2-8-2/src/UCAuto.c Wed Jan 13 06:37:34 1999
+++ lynx2-8-2-patched/src/UCAuto.c Fri Feb 12 20:23:41 1999
@@ -150,11 +150,11 @@ PUBLIC void UCChangeTerminalCodepage ARG
}
remove(old_font);
- free(old_font);
+ FREE(old_font);
old_font = 0;
remove(old_umap);
- free(old_umap);
+ FREE(old_umap);
old_umap = 0;
}
return;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev [patch] [dev16] FREE not free (in general),
John Bley <=