changeset 959:0f798c4b1375

CssPropertyList leak in Html_tag_open_table_cell
author corvid <corvid@lavabit.com>
date Fri, 20 Feb 2009 05:49:23 +0000
parents 1a26b2bd7138
children 5a1818decb62
files src/table.cc
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/table.cc	Tue Feb 17 10:49:19 2009 -0300
+++ b/src/table.cc	Fri Feb 20 05:49:23 2009 +0000
@@ -244,13 +244,6 @@
    const char *attrbuf;
    int32_t bgcolor;
    bool_t new_style;
-   CssPropertyList *props;
-
-   // \todo any shorter way to do this?
-   if (S_TOP(html)->table_cell_props != NULL)
-      props = new CssPropertyList (*S_TOP(html)->table_cell_props);
-   else
-      props = new CssPropertyList ();
 
    switch (S_TOP(html)->table_mode) {
    case DILLO_HTML_TABLE_MODE_NONE:
@@ -273,6 +266,13 @@
       if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "rowspan")))
          rowspan = MAX(1, strtol (attrbuf, NULL, 10));
 
+      CssPropertyList *props;
+      // \todo any shorter way to do this?
+      if (S_TOP(html)->table_cell_props != NULL)
+         props = new CssPropertyList (*S_TOP(html)->table_cell_props);
+      else
+         props = new CssPropertyList ();
+
       /* text style */
       if (!S_TOP(html)->cell_text_align_set) {
          props->set (CSS_PROPERTY_TEXT_ALIGN, CSS_TYPE_ENUM, text_align);