-
Notifications
You must be signed in to change notification settings - Fork 34
sp_init has dead code but could call free twice #168
Copy link
Copy link
Open
Description
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.
Spindle/src/flux/flux-spindle.c
Lines 594 to 598 in 585dacf
| 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:
Spindle/src/flux/flux-spindle.c
Lines 56 to 62 in 585dacf
| #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) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels