diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-02-21 15:40:59 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-02-21 15:40:59 +0200 |
commit | 722533c595a0976e50cca45dca7f28ff7e599970 (patch) | |
tree | 6534bb0f16d74e75237497f3838034ffe7c84509 /src | |
parent | 599a468169078449b68e7c0ef711c14fb746f0ea (diff) | |
download | pies-722533c595a0976e50cca45dca7f28ff7e599970.tar.gz pies-722533c595a0976e50cca45dca7f28ff7e599970.tar.bz2 |
Fix memory leaks when reconfiguring
* grecs: Upgrade.
* src/acl.c (_acl_common_section_parser): Free old value.
* src/pies.c: Mark statically initialized keywords with
GRECS_CONST.
Diffstat (limited to 'src')
-rw-r--r-- | src/acl.c | 5 | ||||
-rw-r--r-- | src/pies.c | 16 |
2 files changed, 12 insertions, 9 deletions
@@ -532,13 +532,16 @@ _acl_common_section_parser (enum grecs_callback_command cmd, | |||
532 | return 1; | 532 | return 1; |
533 | } | 533 | } |
534 | acl = pies_acl_create (tag, locus); | 534 | acl = pies_acl_create (tag, locus); |
535 | if (tag && (acl = pies_acl_install (acl)) == NULL) | 535 | if (tag && (acl = pies_acl_install (acl)) == NULL) |
536 | return 1; | 536 | return 1; |
537 | if (pacl) | 537 | if (pacl) |
538 | *pacl = acl; | 538 | { |
539 | pies_acl_free (*pacl); | ||
540 | *pacl = acl; | ||
541 | } | ||
539 | break; | 542 | break; |
540 | 543 | ||
541 | case grecs_callback_section_end: | 544 | case grecs_callback_section_end: |
542 | acl = *pacl; | 545 | acl = *pacl; |
543 | if (acl->list) | 546 | if (acl->list) |
544 | acl->list->cmp = acl_entry_cmp; | 547 | acl->list->cmp = acl_entry_cmp; |
@@ -1291,13 +1291,13 @@ struct grecs_keyword control_keywords[] = { | |||
1291 | &control.idle_timeout, 0, | 1291 | &control.idle_timeout, 0, |
1292 | NULL, | 1292 | NULL, |
1293 | }, | 1293 | }, |
1294 | {"realm", | 1294 | {"realm", |
1295 | N_("name"), | 1295 | N_("name"), |
1296 | N_("Authentication realm name"), | 1296 | N_("Authentication realm name"), |
1297 | grecs_type_string, GRECS_DFLT, | 1297 | grecs_type_string, GRECS_CONST, |
1298 | &control.realm, 0, | 1298 | &control.realm, 0, |
1299 | NULL, | 1299 | NULL, |
1300 | }, | 1300 | }, |
1301 | { NULL } | 1301 | { NULL } |
1302 | }; | 1302 | }; |
1303 | 1303 | ||
@@ -1375,18 +1375,18 @@ struct grecs_keyword pies_keywords[] = { | |||
1375 | N_("Show source info with debugging messages."), | 1375 | N_("Show source info with debugging messages."), |
1376 | grecs_type_bool, GRECS_DFLT, | 1376 | grecs_type_bool, GRECS_DFLT, |
1377 | &source_info_option, 0, NULL}, | 1377 | &source_info_option, 0, NULL}, |
1378 | {"state-directory", | 1378 | {"state-directory", |
1379 | NULL, | 1379 | NULL, |
1380 | N_("Full file name of the program state directory."), | 1380 | N_("Full file name of the program state directory."), |
1381 | grecs_type_string, GRECS_DFLT, | 1381 | grecs_type_string, GRECS_CONST, |
1382 | &statedir, 0, NULL}, | 1382 | &statedir, 0, NULL}, |
1383 | {"pidfile", | 1383 | {"pidfile", |
1384 | NULL, | 1384 | NULL, |
1385 | N_("Write PID to this file."), | 1385 | N_("Write PID to this file."), |
1386 | grecs_type_string, GRECS_DFLT, | 1386 | grecs_type_string, GRECS_CONST, |
1387 | &pidfile, 0, | 1387 | &pidfile, 0, |
1388 | NULL, | 1388 | NULL, |
1389 | }, | 1389 | }, |
1390 | {"control-file", | 1390 | {"control-file", |
1391 | NULL, | 1391 | NULL, |
1392 | N_("Ignored for compatibility with version 1.2."), | 1392 | N_("Ignored for compatibility with version 1.2."), |
@@ -1401,19 +1401,19 @@ struct grecs_keyword pies_keywords[] = { | |||
1401 | NULL, 0, | 1401 | NULL, 0, |
1402 | NULL, | 1402 | NULL, |
1403 | }, | 1403 | }, |
1404 | {"qotd-file", | 1404 | {"qotd-file", |
1405 | NULL, | 1405 | NULL, |
1406 | N_("Set location of the QOTD file."), | 1406 | N_("Set location of the QOTD file."), |
1407 | grecs_type_string, GRECS_DFLT, | 1407 | grecs_type_string, GRECS_CONST, |
1408 | &qotdfile, 0, | 1408 | &qotdfile, 0, |
1409 | NULL }, | 1409 | NULL }, |
1410 | {"user", | 1410 | {"user", |
1411 | NULL, | 1411 | NULL, |
1412 | N_("Run with this user privileges."), | 1412 | N_("Run with this user privileges."), |
1413 | grecs_type_string, GRECS_DFLT, | 1413 | grecs_type_string, GRECS_CONST, |
1414 | &pies_privs.user, 0, | 1414 | &pies_privs.user, 0, |
1415 | NULL, | 1415 | NULL, |
1416 | }, | 1416 | }, |
1417 | {"group", | 1417 | {"group", |
1418 | NULL, | 1418 | NULL, |
1419 | N_("Retain supplementary group."), | 1419 | N_("Retain supplementary group."), |
@@ -1485,27 +1485,27 @@ struct grecs_keyword pies_keywords[] = { | |||
1485 | NULL, 0, | 1485 | NULL, 0, |
1486 | _cb_include_meta1, | 1486 | _cb_include_meta1, |
1487 | }, | 1487 | }, |
1488 | {"meta1-queue-dir", | 1488 | {"meta1-queue-dir", |
1489 | NULL, | 1489 | NULL, |
1490 | N_("Set the name of MeTA1 queue directory (default /var/spool/meta1)."), | 1490 | N_("Set the name of MeTA1 queue directory (default /var/spool/meta1)."), |
1491 | grecs_type_string, GRECS_DFLT, | 1491 | grecs_type_string, GRECS_CONST, |
1492 | &meta1_queue_dir, 0, | 1492 | &meta1_queue_dir, 0, |
1493 | NULL, | 1493 | NULL, |
1494 | }, | 1494 | }, |
1495 | {"mailer-program", | 1495 | {"mailer-program", |
1496 | NULL, | 1496 | NULL, |
1497 | N_("Full path to the mailer binary."), | 1497 | N_("Full path to the mailer binary."), |
1498 | grecs_type_string, GRECS_DFLT, | 1498 | grecs_type_string, GRECS_CONST, |
1499 | &mailer_program, 0, | 1499 | &mailer_program, 0, |
1500 | NULL | 1500 | NULL |
1501 | }, | 1501 | }, |
1502 | {"mailer-command-line", | 1502 | {"mailer-command-line", |
1503 | NULL, | 1503 | NULL, |
1504 | N_("Mailer command line (without recipient addresses)."), | 1504 | N_("Mailer command line (without recipient addresses)."), |
1505 | grecs_type_string, GRECS_DFLT, | 1505 | grecs_type_string, GRECS_CONST, |
1506 | &mailer_command_line, 0, | 1506 | &mailer_command_line, 0, |
1507 | NULL | 1507 | NULL |
1508 | }, | 1508 | }, |
1509 | { "identity-provider", "name: string", "Configure identity provider", | 1509 | { "identity-provider", "name: string", "Configure identity provider", |
1510 | grecs_type_section, GRECS_INAC | GRECS_HIDDEN }, | 1510 | grecs_type_section, GRECS_INAC | GRECS_HIDDEN }, |
1511 | {NULL} | 1511 | {NULL} |