--- gettext-0.19.8.1/gettext-tools/src/read-catalog.c
+++ gettext-0.19.8.1/gettext-tools/src/read-catalog.c
@@ -397,6 +397,8 @@ default_add_message (default_catalog_reader_ty *this,
          appropriate.  */
       mp = message_alloc (msgctxt, msgid, msgid_plural, msgstr, msgstr_len,
                           msgstr_pos);
+      if (msgid_plural != NULL)
+        free (msgid_plural);
       mp->prev_msgctxt = prev_msgctxt;
       mp->prev_msgid = prev_msgid;
       mp->prev_msgid_plural = prev_msgid_plural;
--- a/gettext-tools/src/po-gram-gen.y
+++ b/gettext-tools/src/po-gram-gen.y
@@ -221,14 +221,11 @@ message
                   check_obsolete ($1, $3);
                   check_obsolete ($1, $4);
                   if (!$1.obsolete || pass_obsolete_entries)
-                    {
-                      do_callback_message ($1.ctxt, string2, &$1.pos, $3.string,
-                                           $4.rhs.msgstr, $4.rhs.msgstr_len, &$4.pos,
-                                           $1.prev_ctxt,
-                                           $1.prev_id, $1.prev_id_plural,
-                                           $1.obsolete);
-                      free ($3.string);
-                    }
+                    do_callback_message ($1.ctxt, string2, &$1.pos, $3.string,
+                                         $4.rhs.msgstr, $4.rhs.msgstr_len, &$4.pos,
+                                         $1.prev_ctxt,
+                                         $1.prev_id, $1.prev_id_plural,
+                                         $1.obsolete);
                   else
                     {
                       free_message_intro ($1);
--- gettext-0.19.2/gettext-tools/src/po-gram-gen.c	2014-07-14 09:31:39.000000000 +0200
+++ po-gram-gen_2.c	2019-07-26 14:56:48.246257254 +0200
@@ -586,9 +586,9 @@
 static const yytype_uint16 yyrline[] =
 {
        0,   168,   168,   170,   171,   172,   173,   178,   186,   194,
-     215,   239,   248,   257,   268,   277,   291,   300,   314,   320,
-     331,   337,   349,   360,   371,   375,   390,   413,   421,   433,
-     441
+     215,   236,   245,   254,   265,   274,   288,   297,   311,   317,
+     328,   334,   346,   357,   368,   372,   387,   410,   418,   430,
+     438
 };
 #endif
 
@@ -1560,14 +1560,11 @@
                   check_obsolete ((yyvsp[(1) - (4)].message_intro), (yyvsp[(3) - (4)].string));
                   check_obsolete ((yyvsp[(1) - (4)].message_intro), (yyvsp[(4) - (4)].rhs));
                   if (!(yyvsp[(1) - (4)].message_intro).obsolete || pass_obsolete_entries)
-                    {
-                      do_callback_message ((yyvsp[(1) - (4)].message_intro).ctxt, string2, &(yyvsp[(1) - (4)].message_intro).pos, (yyvsp[(3) - (4)].string).string,
-                                           (yyvsp[(4) - (4)].rhs).rhs.msgstr, (yyvsp[(4) - (4)].rhs).rhs.msgstr_len, &(yyvsp[(4) - (4)].rhs).pos,
-                                           (yyvsp[(1) - (4)].message_intro).prev_ctxt,
-                                           (yyvsp[(1) - (4)].message_intro).prev_id, (yyvsp[(1) - (4)].message_intro).prev_id_plural,
-                                           (yyvsp[(1) - (4)].message_intro).obsolete);
-                      free ((yyvsp[(3) - (4)].string).string);
-                    }
+                    do_callback_message ((yyvsp[(1) - (4)].message_intro).ctxt, string2, &(yyvsp[(1) - (4)].message_intro).pos, (yyvsp[(3) - (4)].string).string,
+                                         (yyvsp[(4) - (4)].rhs).rhs.msgstr, (yyvsp[(4) - (4)].rhs).rhs.msgstr_len, &(yyvsp[(4) - (4)].rhs).pos,
+                                         (yyvsp[(1) - (4)].message_intro).prev_ctxt,
+                                         (yyvsp[(1) - (4)].message_intro).prev_id, (yyvsp[(1) - (4)].message_intro).prev_id_plural,
+                                         (yyvsp[(1) - (4)].message_intro).obsolete);
                   else
                     {
                       free_message_intro ((yyvsp[(1) - (4)].message_intro));
@@ -1580,7 +1577,7 @@
 
   case 11:
 /* Line 1792 of yacc.c  */
-#line 240 "po-gram-gen.y"
+#line 237 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (3)].message_intro), (yyvsp[(2) - (3)].stringlist));
                   check_obsolete ((yyvsp[(1) - (3)].message_intro), (yyvsp[(3) - (3)].string));
@@ -1593,7 +1590,7 @@
 
   case 12:
 /* Line 1792 of yacc.c  */
-#line 249 "po-gram-gen.y"
+#line 246 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (3)].message_intro), (yyvsp[(2) - (3)].stringlist));
                   check_obsolete ((yyvsp[(1) - (3)].message_intro), (yyvsp[(3) - (3)].rhs));
@@ -1606,7 +1603,7 @@
 
   case 13:
 /* Line 1792 of yacc.c  */
-#line 258 "po-gram-gen.y"
+#line 255 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].message_intro), (yyvsp[(2) - (2)].stringlist));
                   po_gram_error_at_line (&(yyvsp[(1) - (2)].message_intro).pos, _("missing 'msgstr' section"));
@@ -1617,7 +1614,7 @@
 
   case 14:
 /* Line 1792 of yacc.c  */
-#line 269 "po-gram-gen.y"
+#line 266 "po-gram-gen.y"
     {
                   (yyval.message_intro).prev_ctxt = NULL;
                   (yyval.message_intro).prev_id = NULL;
@@ -1630,7 +1627,7 @@
 
   case 15:
 /* Line 1792 of yacc.c  */
-#line 278 "po-gram-gen.y"
+#line 275 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].prev), (yyvsp[(2) - (2)].string));
                   (yyval.message_intro).prev_ctxt = (yyvsp[(1) - (2)].prev).ctxt;
@@ -1644,7 +1641,7 @@
 
   case 16:
 /* Line 1792 of yacc.c  */
-#line 292 "po-gram-gen.y"
+#line 289 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].stringlist));
                   (yyval.prev).ctxt = (yyvsp[(1) - (2)].string).string;
@@ -1657,7 +1654,7 @@
 
   case 17:
 /* Line 1792 of yacc.c  */
-#line 301 "po-gram-gen.y"
+#line 298 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (3)].string), (yyvsp[(2) - (3)].stringlist));
                   check_obsolete ((yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].string));
@@ -1671,7 +1668,7 @@
 
   case 18:
 /* Line 1792 of yacc.c  */
-#line 315 "po-gram-gen.y"
+#line 312 "po-gram-gen.y"
     {
                   (yyval.string).string = NULL;
                   (yyval.string).pos = (yyvsp[(1) - (1)].pos).pos;
@@ -1681,7 +1678,7 @@
 
   case 19:
 /* Line 1792 of yacc.c  */
-#line 321 "po-gram-gen.y"
+#line 318 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].stringlist));
                   check_obsolete ((yyvsp[(1) - (3)].pos), (yyvsp[(3) - (3)].pos));
@@ -1693,7 +1690,7 @@
 
   case 20:
 /* Line 1792 of yacc.c  */
-#line 332 "po-gram-gen.y"
+#line 329 "po-gram-gen.y"
     {
                   (yyval.string).string = NULL;
                   (yyval.string).pos = (yyvsp[(1) - (1)].pos).pos;
@@ -1703,7 +1700,7 @@
 
   case 21:
 /* Line 1792 of yacc.c  */
-#line 338 "po-gram-gen.y"
+#line 335 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].stringlist));
                   check_obsolete ((yyvsp[(1) - (3)].pos), (yyvsp[(3) - (3)].pos));
@@ -1715,7 +1712,7 @@
 
   case 22:
 /* Line 1792 of yacc.c  */
-#line 350 "po-gram-gen.y"
+#line 347 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].pos), (yyvsp[(2) - (2)].stringlist));
                   plural_counter = 0;
@@ -1727,7 +1724,7 @@
 
   case 23:
 /* Line 1792 of yacc.c  */
-#line 361 "po-gram-gen.y"
+#line 358 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].pos), (yyvsp[(2) - (2)].stringlist));
                   (yyval.string).string = string_list_concat_destroy (&(yyvsp[(2) - (2)].stringlist).stringlist);
@@ -1738,7 +1735,7 @@
 
   case 24:
 /* Line 1792 of yacc.c  */
-#line 372 "po-gram-gen.y"
+#line 369 "po-gram-gen.y"
     {
                   (yyval.rhs) = (yyvsp[(1) - (1)].rhs);
                 }
@@ -1746,7 +1743,7 @@
 
   case 25:
 /* Line 1792 of yacc.c  */
-#line 376 "po-gram-gen.y"
+#line 373 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].rhs), (yyvsp[(2) - (2)].rhs));
                   (yyval.rhs).rhs.msgstr = XNMALLOC ((yyvsp[(1) - (2)].rhs).rhs.msgstr_len + (yyvsp[(2) - (2)].rhs).rhs.msgstr_len, char);
@@ -1762,7 +1759,7 @@
 
   case 26:
 /* Line 1792 of yacc.c  */
-#line 391 "po-gram-gen.y"
+#line 388 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].pos));
                   check_obsolete ((yyvsp[(1) - (5)].pos), (yyvsp[(3) - (5)].number));
@@ -1785,7 +1782,7 @@
 
   case 27:
 /* Line 1792 of yacc.c  */
-#line 414 "po-gram-gen.y"
+#line 411 "po-gram-gen.y"
     {
                   string_list_init (&(yyval.stringlist).stringlist);
                   string_list_append (&(yyval.stringlist).stringlist, (yyvsp[(1) - (1)].string).string);
@@ -1797,7 +1794,7 @@
 
   case 28:
 /* Line 1792 of yacc.c  */
-#line 422 "po-gram-gen.y"
+#line 419 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].stringlist), (yyvsp[(2) - (2)].string));
                   (yyval.stringlist).stringlist = (yyvsp[(1) - (2)].stringlist).stringlist;
@@ -1810,7 +1807,7 @@
 
   case 29:
 /* Line 1792 of yacc.c  */
-#line 434 "po-gram-gen.y"
+#line 431 "po-gram-gen.y"
     {
                   string_list_init (&(yyval.stringlist).stringlist);
                   string_list_append (&(yyval.stringlist).stringlist, (yyvsp[(1) - (1)].string).string);
@@ -1822,7 +1819,7 @@
 
   case 30:
 /* Line 1792 of yacc.c  */
-#line 442 "po-gram-gen.y"
+#line 439 "po-gram-gen.y"
     {
                   check_obsolete ((yyvsp[(1) - (2)].stringlist), (yyvsp[(2) - (2)].string));
                   (yyval.stringlist).stringlist = (yyvsp[(1) - (2)].stringlist).stringlist;
@@ -1835,7 +1832,7 @@
 
 
 /* Line 1792 of yacc.c  */
-#line 1839 "po-gram-gen.c"
+#line 1836 "po-gram-gen.c"
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
