Changeset: 1d7573f9f607 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d7573f9f607
Modified Files:
        sql/backends/monet5/bam/bam_wrapper.c
Branch: Oct2014
Log Message:

Free memory *after* last use.


diffs (48 lines):

diff --git a/sql/backends/monet5/bam/bam_wrapper.c 
b/sql/backends/monet5/bam/bam_wrapper.c
--- a/sql/backends/monet5/bam/bam_wrapper.c
+++ b/sql/backends/monet5/bam/bam_wrapper.c
@@ -798,11 +798,12 @@ process_header(bam_wrapper * bw)
 
                                        /* if this point is reached, option
                                         * wasn't recognized */
-                                       clear_bam_header_line(&hl);
-                                       throw(MAL, "process_header",
+                                       msg = createException(MAL, 
"process_header",
                                                  ERR_PROCESS_HEADER
                                                  "Unknown option '%s' found in 
header tag HD",
                                                  bw->file_location, 
hl.options[o].tag);
+                                       clear_bam_header_line(&hl);
+                                       return msg;
                                }
                                if (!hd_fields_found[0]) {
                                        clear_bam_header_line(&hl);
@@ -847,11 +848,12 @@ process_header(bam_wrapper * bw)
 
                                        /* if this point is reached, option
                                         * wasn't recognized */
-                                       clear_bam_header_line(&hl);
-                                       throw(MAL, "process_header",
+                                       msg = createException(MAL, 
"process_header",
                                                  ERR_PROCESS_HEADER
                                                  "Unknown option '%s' found in 
header tag SQ",
                                                  bw->file_location, 
hl.options[o].tag);
+                                       clear_bam_header_line(&hl);
+                                       return msg;
                                }
                                if (!sq_fields_found[0]) {
                                        clear_bam_header_line(&hl);
@@ -1063,11 +1065,12 @@ process_header(bam_wrapper * bw)
                                kputs(hl.options[0].value, &hd_comment);
                                comment_found = TRUE;
                        } else {
-                               clear_bam_header_line(&hl);
-                               throw(MAL, "process_header",
+                               msg = createException(MAL, "process_header",
                                          ERR_PROCESS_HEADER
                                          "Incorrect header tag '%s' found in 
BAM file",
                                          bw->file_location, hl.header_tag);
+                               clear_bam_header_line(&hl);
+                               return msg;
                        }
 
                        /* everything went ok, clear the header line and move
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to