Bug:
spindle_ctx_destroy doesn't get called since logerrno_printf_and_return macro expands with its own return. ctx will still be freed in destructor but potential for double free.
|
rc = spindle_in_session_mode(h, NULL, NULL); |
|
if (rc == -1) { |
|
logerrno_printf_and_return(1, "failed to read session info from flux\n"); |
|
spindle_ctx_destroy(ctx); |
|
return -1; |
macro:
|
#define logerrno_printf_and_return(PRIORITY, FORMAT, ...) \ |
|
do { \ |
|
int log_errno_result; \ |
|
spindle_debug_printf(PRIORITY, FORMAT, ## __VA_ARGS__); \ |
|
log_errno_result = shell_log_errno(FORMAT, ## __VA_ARGS__); \ |
|
return log_errno_result; \ |
|
} while (0) |
Bug:
spindle_ctx_destroydoesn't get called sincelogerrno_printf_and_returnmacro expands with its own return.ctxwill still be freed in destructor but potential for double free.Spindle/src/flux/flux-spindle.c
Lines 594 to 598 in 585dacf
macro:
Spindle/src/flux/flux-spindle.c
Lines 56 to 62 in 585dacf