Commit 4a3b7496 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

r17639@catbus: nickm | 2008-01-15 19:09:21 -0500

 Fix some hard to trigger but nonetheless real memory leaks spotted by an anonymous contributor.  Needs review.  Partial backport candidate.


svn:r13147
parent 24aae484
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ Changes in version 0.2.0.16-alpha - 2008-01-??
      but client versions are not.
    - Fix rare bug on REDIRECTSTREAM control command when called with no
      port set: it could erroneously report an error when none had happened.
    - Avoid bogus crash-prone, leak-prone tor_realloc when we're compressing
      large objects and find ourselves with more than 4k left over.  Bugfix
      on 0.2.0.
    - Fix a small memory leak when setting up a hidden service.
    - Fix a few memory leaks that could in theory happen under bizarre error
      conditions.

  o Minor features (controller):
    - Get NS events working again.  (Patch from tup)
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ tor_gzip_compress(char **out, size_t *out_len,
  *out_len = stream->total_out;
  if (stream->total_out > out_size + 4097) {
    /* If we're wasting more than 4k, don't. */
    tor_realloc(*out, stream->total_out + 1);
    *out = tor_realloc(*out, stream->total_out + 1);
  }
  if (deflateEnd(stream)!=Z_OK) {
    log_warn(LD_BUG, "Error freeing gzip structures");
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ const char tortls_c_id[] =
#include <string.h>

// #define V2_HANDSHAKE_SERVER
// #define V2_HANDSHAKE_CLIENT
#define V2_HANDSHAKE_CLIENT

/* Copied from or.h */
#define LEGAL_NICKNAME_CHARACTERS \
+3 −0
Original line number Diff line number Diff line
@@ -1153,6 +1153,8 @@ options_act(or_options_t *old_options)
      if (parse_redirect_line(sl, cl, &errmsg)<0) {
        log_warn(LD_CONFIG, "%s", errmsg);
        tor_free(errmsg);
        SMARTLIST_FOREACH(sl, exit_redirect_t *, er, tor_free(er));
        smartlist_free(sl);
        return -1;
      }
    }
@@ -2096,6 +2098,7 @@ list_torrc_options(void)
      smartlist_clear(lines);
    }
  }
  smartlist_free(lines);
}

/** Last value actually set by resolve_my_address. */
+2 −0
Original line number Diff line number Diff line
@@ -704,6 +704,7 @@ control_setconf_helper(control_connection_t *conn, uint32_t len, char *body,
          connection_write_str_to_buf("551 Couldn't parse string\r\n", conn);
          SMARTLIST_FOREACH(entries, char *, cp, tor_free(cp));
          smartlist_free(entries);
          tor_free(key);
          return 0;
        }
      }
@@ -1440,6 +1441,7 @@ getinfo_helper_dir(control_connection_t *control_conn,
    res = dirserv_get_routerdescs(descs, url, &msg);
    if (res) {
      log_warn(LD_CONTROL, "getinfo '%s': %s", question, msg);
      smartlist_free(descs);
      return -1;
    }
    SMARTLIST_FOREACH(descs, signed_descriptor_t *, sd,
Loading