From f468bc4e4d22de0b22536125ed541c18d7bce531 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 19 Feb 2009 08:56:11 +0000 Subject: [PATCH] ebl Fix #1226 about bconsole segfault when using readline() git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8481 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/console/console.c | 6 ++++-- bacula/technotes-2.5 | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 4150407e7d..c1f0d2c128 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -344,7 +344,6 @@ static int tls_pem_callback(char *buf, int size, const void *userdata) #ifdef HAVE_READLINE #define READLINE_LIBRARY 1 -#undef free #include "readline.h" #include "history.h" @@ -372,6 +371,9 @@ get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec) if (line == NULL) { do_history = 0; rl_catch_signals = 0; /* do it ourselves */ + /* Here, readline does ***real*** malloc + * so, be we have to use the real free + */ line = readline((char *)prompt); /* cast needed for old readlines */ if (!line) { exit(1); @@ -412,7 +414,7 @@ get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec) if (do_history) { add_history(line); } - free(line); + actuallyfree(line); /* allocated by readline() malloc */ line = NULL; } return 1; diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 387cc3dc97..6bd07b42f5 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -25,6 +25,8 @@ filepattern (restore with regex in bsr) mixed priorities General: +19Feb09 +ebl Fix #1226 about bconsole segfault when using readline() 18Feb09 kes Apply Eric's next-beta.patch that enables 64 bit FileIds and adds new columns to the catalog. -- 2.39.5