]> diplodocus.org Git - nmh/commitdiff
Avoid free() in format engine for now.
authorKen Hornstein <kenh@pobox.com>
Mon, 12 Feb 2018 21:01:08 +0000 (16:01 -0500)
committerKen Hornstein <kenh@pobox.com>
Mon, 12 Feb 2018 21:01:08 +0000 (16:01 -0500)
This free() call messes up the buffer handling in scansbr.c:scan();
for now we're going to live with the leak and fix this properly when
we normalize the format engine's memory handling.

sbr/fmt_scan.c

index b8e59e0..f9aee54 100644 (file)
@@ -1148,7 +1148,11 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
                               comp->c_mn will be run through
                               FT_LS_ADDR, which will strip off any
                               pers name. */
                               comp->c_mn will be run through
                               FT_LS_ADDR, which will strip off any
                               pers name. */
-                           free (comp->c_text);
+                           /* NB: We remove the call to free() here
+                              because it interferes with the buffer
+                              management in scansbr.c.  Revisit this
+                              when we clean up memory handling */
+                           /* free (comp->c_text); */
                            comp->c_text = str = strdup (mn->m_text);
                            comp->c_mn = mn;
                        }
                            comp->c_text = str = strdup (mn->m_text);
                            comp->c_mn = mn;
                        }