Fix memory leak and typo in comments.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 22 Aug 2018 04:24:08 +0000 (13:24 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 22 Aug 2018 04:24:08 +0000 (13:24 +0900)
src/tools/pgproto/extended_query.c

index 4fc01557a9dda43904836f91d27b7834031472c7..9d2f3a8aa2490f6bd1e3fb328ff904ddb736f53a 100644 (file)
@@ -93,7 +93,9 @@ process_parse(char *buf, PGconn *conn)
        send_char('P', conn);
        send_int(len, conn);
        send_string(stmt, conn);
+       free(stmt);
        send_string(query, conn);
+       free(query);
        send_int16(noids, conn);
        if (noids > 0)
        {
@@ -105,7 +107,7 @@ process_parse(char *buf, PGconn *conn)
 }
 
 /*
- * Send bind messae. "conn" should be at the point right after the message kind
+ * Send bind message. "conn" should be at the point right after the message kind
  * was read.
  */
 void
@@ -323,6 +325,7 @@ process_describe(char *buf, PGconn *conn)
        send_int(len, conn);
        send_char(kind, conn);
        send_string(stmt, conn);
+       free(stmt);
 }
 
 /*