diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-02 01:49:13 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-02 01:49:13 +0200 |
commit | de89205bdf419e68beece4e205af40e3d81f01ef (patch) | |
tree | 288ad57b06a33dbb0d0bde90d60ba4b5997a7cd7 | |
parent | ff59b7b112e5dd9a69e138aa01b91d76c8b04be6 (diff) | |
download | busybox-w32-de89205bdf419e68beece4e205af40e3d81f01ef.tar.gz busybox-w32-de89205bdf419e68beece4e205af40e3d81f01ef.tar.bz2 busybox-w32-de89205bdf419e68beece4e205af40e3d81f01ef.zip |
test: memory leak: free group id list
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/test.c | 1 | ||||
-rw-r--r-- | shell/ash.c | 12 |
2 files changed, 6 insertions, 7 deletions
diff --git a/coreutils/test.c b/coreutils/test.c index 7b8b10cd9..afdb1413f 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -394,6 +394,7 @@ extern struct test_statics *const test_ptr_to_statics; | |||
394 | barrier(); \ | 394 | barrier(); \ |
395 | } while (0) | 395 | } while (0) |
396 | #define DEINIT_S() do { \ | 396 | #define DEINIT_S() do { \ |
397 | free(S.group_array); \ | ||
397 | free(test_ptr_to_statics); \ | 398 | free(test_ptr_to_statics); \ |
398 | } while (0) | 399 | } while (0) |
399 | 400 | ||
diff --git a/shell/ash.c b/shell/ash.c index b8160433e..731c4b2b0 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -412,8 +412,6 @@ static void trace_vprintf(const char *fmt, va_list va); | |||
412 | 412 | ||
413 | 413 | ||
414 | /* ============ Utility functions */ | 414 | /* ============ Utility functions */ |
415 | #define xbarrier() do { __asm__ __volatile__ ("": : :"memory"); } while (0) | ||
416 | |||
417 | #define is_name(c) ((c) == '_' || isalpha((unsigned char)(c))) | 415 | #define is_name(c) ((c) == '_' || isalpha((unsigned char)(c))) |
418 | #define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c))) | 416 | #define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c))) |
419 | 417 | ||
@@ -446,7 +444,7 @@ static void exitshell(void) NORETURN; | |||
446 | */ | 444 | */ |
447 | #define INT_OFF do { \ | 445 | #define INT_OFF do { \ |
448 | suppress_int++; \ | 446 | suppress_int++; \ |
449 | xbarrier(); \ | 447 | barrier(); \ |
450 | } while (0) | 448 | } while (0) |
451 | 449 | ||
452 | /* | 450 | /* |
@@ -516,7 +514,7 @@ raise_interrupt(void) | |||
516 | static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void | 514 | static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void |
517 | int_on(void) | 515 | int_on(void) |
518 | { | 516 | { |
519 | xbarrier(); | 517 | barrier(); |
520 | if (--suppress_int == 0 && pending_int) { | 518 | if (--suppress_int == 0 && pending_int) { |
521 | raise_interrupt(); | 519 | raise_interrupt(); |
522 | } | 520 | } |
@@ -525,7 +523,7 @@ int_on(void) | |||
525 | static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void | 523 | static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void |
526 | force_int_on(void) | 524 | force_int_on(void) |
527 | { | 525 | { |
528 | xbarrier(); | 526 | barrier(); |
529 | suppress_int = 0; | 527 | suppress_int = 0; |
530 | if (pending_int) | 528 | if (pending_int) |
531 | raise_interrupt(); | 529 | raise_interrupt(); |
@@ -535,7 +533,7 @@ force_int_on(void) | |||
535 | #define SAVE_INT(v) ((v) = suppress_int) | 533 | #define SAVE_INT(v) ((v) = suppress_int) |
536 | 534 | ||
537 | #define RESTORE_INT(v) do { \ | 535 | #define RESTORE_INT(v) do { \ |
538 | xbarrier(); \ | 536 | barrier(); \ |
539 | suppress_int = (v); \ | 537 | suppress_int = (v); \ |
540 | if (suppress_int == 0 && pending_int) \ | 538 | if (suppress_int == 0 && pending_int) \ |
541 | raise_interrupt(); \ | 539 | raise_interrupt(); \ |
@@ -8432,7 +8430,7 @@ dotrap(void) | |||
8432 | 8430 | ||
8433 | last_status = exitstatus; | 8431 | last_status = exitstatus; |
8434 | pending_sig = 0; | 8432 | pending_sig = 0; |
8435 | xbarrier(); | 8433 | barrier(); |
8436 | 8434 | ||
8437 | TRACE(("dotrap entered\n")); | 8435 | TRACE(("dotrap entered\n")); |
8438 | for (sig = 1, g = gotsig; sig < NSIG; sig++, g++) { | 8436 | for (sig = 1, g = gotsig; sig < NSIG; sig++, g++) { |