Skip to content

Commit

Permalink
GH-63 Revert e64c60a to avoid double-free; forgot that
Browse files Browse the repository at this point in the history
alineInit() setups a clean-up handler.
  • Loading branch information
SirWumpus committed Nov 8, 2024
1 parent e64c60a commit cd162f5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/aline.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sig_winch(int signum)
}
#pragma GCC diagnostic pop

void
static void
alineFini(void)
{
alineSetMode(ALINE_CANONICAL);
Expand Down
1 change: 0 additions & 1 deletion src/aline.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ extern struct winsize window;

#define ALINE_HISTORY 16

extern void alineFini(void);
extern int alineInit(int hist_size);
extern int alineReadByte(void);
extern int alineSetMode(int mode);
Expand Down
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ cleanup(void)
p4Free(ctx_main);
/* This is redundant too, but I like it for symmetry. */
sig_fini();
p4Fini();
}

int
Expand Down
2 changes: 0 additions & 2 deletions src/post4.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,6 @@ typedef struct {
*/
extern void p4Init(P4_Options *opts);

#define p4Fini() alineFini()

/**
* Create a new interpreter context.
*
Expand Down

0 comments on commit cd162f5

Please sign in to comment.