]> diplodocus.org Git - nmh/blobdiff - uip/new.c
Use variable-size (but in one case, fixed but larger) buffers for the SASL
[nmh] / uip / new.c
index 8d235b17af593a63fb3e41da07c1678506bb719e..bdbdc73f127eb8a2a8af1c14ae259764d7c18a21 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -114,11 +114,11 @@ get_msgnums(char *folder, char *sequences[])
        return NULL;
 
     if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) {
        return NULL;
 
     if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) {
-       free(seqfile);
 
        if (failed_to_lock) {
            adios (seqfile, "failed to lock");
        } else {
 
        if (failed_to_lock) {
            adios (seqfile, "failed to lock");
        } else {
+           free(seqfile);
            return NULL;
        }
     }
            return NULL;
        }
     }
@@ -406,8 +406,11 @@ doit(char *cur, char *folders, char *sequences[])
 
     /* If we're fnext, we haven't checked the last node yet.  If it's the
      * current folder, return the first node. */
 
     /* If we're fnext, we haven't checked the last node yet.  If it's the
      * current folder, return the first node. */
-    if (run_mode == FNEXT && strcmp(last->n_name, cur) == 0) {
-        return first;
+    if (run_mode == FNEXT) {
+       assert(last != NULL);
+       if (strcmp(last->n_name, cur) == 0) {
+            return first;
+       }
     }
 
     if (run_mode == NEW) {
     }
 
     if (run_mode == NEW) {