lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [PATCH][pre2] local_dired cleanup


From: John Bley
Subject: lynx-dev [PATCH][pre2] local_dired cleanup
Date: Wed, 12 May 1999 14:33:20 -0400 (EDT)

* Fix a few leaks and perform a minor cleanup in local_dired (John Bley)

-- 
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/LYLocal.c lynx2-8-2-patched/src/LYLocal.c
--- lynx2-8-2/src/LYLocal.c     Sat May  8 13:46:28 1999
+++ lynx2-8-2-patched/src/LYLocal.c     Wed May 12 14:27:48 1999
@@ -1345,7 +1345,7 @@ PUBLIC int local_dired ARGS1(
 {
     char *line_url;    /* will point to doc's address, which is a URL */
     char *line = NULL; /* same as line_url, but HTUnEscaped, will be alloced */
-    char *tp;
+    char *tp = NULL;
     char *tmpbuf = NULL;
     char *buffer = NULL;
     char *dirname = NULL;
@@ -1360,7 +1360,6 @@ PUBLIC int local_dired ARGS1(
     HTUnEscape(line);  /* _file_ (not URL) syntax, for those functions
                           that need it.  Don't forget to FREE it. */
 
-    tp = NULL;
     if (!strncmp(line, "LYNXDIRED://NEW_FILE", 20)) {
        if (create_file(&line[20]) > 0)
            LYforce_no_cache = TRUE;
@@ -1370,10 +1369,11 @@ PUBLIC int local_dired ARGS1(
     } else if (!strncmp(line, "LYNXDIRED://INSTALL_SRC", 23)) {
        local_install(NULL, &line[23], &tp);
        StrAllocCopy(doc->address, tp);
+       FREE(tp);
        FREE(line);
        return 0;
     } else if (!strncmp(line, "LYNXDIRED://INSTALL_DEST", 24)) {
-       local_install(&line[24], NULL, &tp);
+       local_install(&line[24], NULL, &tp);    
        LYpop(doc);
     } else if (!strncmp(line, "LYNXDIRED://MODIFY_NAME", 23)) {
        if (modify_name(&line[23]) > 0)
@@ -1393,6 +1393,7 @@ PUBLIC int local_dired ARGS1(
             */
            StrAllocCopy(doc->address, tp);
        FREE(line);
+       FREE(tp);
        return 0;
     } else if (!strncmp(line, "LYNXDIRED://PERMIT_LOCATION", 27)) {
        permit_location(&line_url[27], NULL, &tp);
@@ -1570,6 +1571,7 @@ PUBLIC int local_dired ARGS1(
     FREE(tmpbuf);
     FREE(buffer);
     FREE(line);
+    FREE(tp);
     LYpop(doc);
     return 0;
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]