From 533cb8166926d570dc3ad279273fac2f4fa9d70f Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 22 Jul 2020 18:02:05 -0300 Subject: [PATCH] Refactoring "can't connect" popup message. --- lib3270.cbp | 9 ++++----- src/core/connect.c | 29 ++++++++++++++++++++++++++++- src/core/host.c | 2 ++ src/core/linux/connect.c | 28 ++++------------------------ src/core/popup.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/core/screen.c | 126 ------------------------------------------------------------------------------------------------------------------------------ src/core/session.c | 28 +++++++++++++--------------- src/core/telnet.c | 7 ++++++- src/core/toggles/init.c | 2 +- src/core/util.c | 29 +++++++++++++++-------------- src/core/windows/connect.c | 32 ++++++-------------------------- src/include/internals.h | 5 +---- src/include/lib3270/popup.h | 2 +- src/ssl/notify.c | 4 +++- 14 files changed, 202 insertions(+), 219 deletions(-) create mode 100644 src/core/popup.c diff --git a/lib3270.cbp b/lib3270.cbp index 4c91b75..06988b7 100644 --- a/lib3270.cbp +++ b/lib3270.cbp @@ -149,6 +149,9 @@ + + @@ -357,10 +360,6 @@ - - - - - + diff --git a/src/core/connect.c b/src/core/connect.c index 124cf4c..c3e1f18 100644 --- a/src/core/connect.c +++ b/src/core/connect.c @@ -37,6 +37,7 @@ #include #include "../ssl/crl.h" +#include "utilc.h" /*---[ Implement ]-------------------------------------------------------------------------------*/ @@ -70,13 +71,39 @@ #endif // HAVE_LIBSSL + void connection_failed(H3270 *hSession, const char *message) + { + lib3270_disconnect(hSession); + + lib3270_autoptr(char) summary = lib3270_strdup_printf( + _( "Can't connect to %s:%s"), + hSession->host.current, + hSession->host.srvc + ); + + LIB3270_POPUP popup = { + .name = "CantConnect", + .title = _( "Connection failed" ), + .type = LIB3270_NOTIFY_INFO, + .summary = summary, + .body = message + }; + + if(hSession->cbk.popup_show(hSession,&popup,lib3270_get_toggle(hSession,LIB3270_TOGGLE_RECONNECT) && !hSession->auto_reconnect_inprogress) == 0) { + // Schedule an automatic reconnection. + hSession->auto_reconnect_inprogress = 1; + (void) AddTimer(RECONNECT_ERR_MS, hSession, lib3270_check_for_auto_reconnect); + } + + } + int lib3270_allow_reconnect(const H3270 *hSession) { // // Can't reconnect if already reconnecting *OR* there's an open popup // (to avoid open more than one connect error popup). // - if(hSession->auto_reconnect_inprogress || hSession->popups) + if(hSession->auto_reconnect_inprogress) { errno = EBUSY; return 0; diff --git a/src/core/host.c b/src/core/host.c index f2bf29e..f037ec4 100644 --- a/src/core/host.c +++ b/src/core/host.c @@ -66,11 +66,13 @@ */ int lib3270_check_for_auto_reconnect(H3270 *hSession) { + /* if(hSession->popups) { lib3270_write_log(hSession,"3270","Delaying auto-reconnect. There's %u pending popup(s)",(unsigned int) hSession->popups); return 1; } + */ if(hSession->auto_reconnect_inprogress) { diff --git a/src/core/linux/connect.c b/src/core/linux/connect.c index 162165d..88b38ff 100644 --- a/src/core/linux/connect.c +++ b/src/core/linux/connect.c @@ -50,6 +50,7 @@ #include "trace_dsc.h" #include "telnetc.h" #include "screen.h" +#include "utilc.h" #include #include @@ -57,7 +58,6 @@ /*---[ Implement ]-------------------------------------------------------------------------------*/ - static void net_connected(H3270 *hSession, int GNUC_UNUSED(fd), LIB3270_IO_FLAG GNUC_UNUSED(flag), void GNUC_UNUSED(*dunno)) { int err; @@ -83,18 +83,8 @@ static void net_connected(H3270 *hSession, int GNUC_UNUSED(fd), LIB3270_IO_FLAG } else if(err) { - char buffer[4096]; - - snprintf(buffer,4095,_( "Can't connect to %s" ), lib3270_get_url(hSession) ); - - lib3270_disconnect(hSession); - lib3270_popup_dialog( - hSession, - LIB3270_NOTIFY_ERROR, - _( "Connection failed" ), - buffer, - _( "%s" ), strerror(err) - ); + lib3270_autoptr(char) body = lib3270_strdup_printf(_("%s (rc=%d)"),strerror(err),err); + connection_failed(hSession,body); return; } @@ -176,17 +166,7 @@ static void net_connected(H3270 *hSession, int GNUC_UNUSED(fd), LIB3270_IO_FLAG // Connect to host if(lib3270_run_task(hSession, background_connect, &host) || hSession->connection.sock < 0) { - char buffer[4096]; - snprintf(buffer,4095,_( "Can't connect to %s:%s"), hSession->host.current, hSession->host.srvc); - - lib3270_popup_dialog( hSession, - LIB3270_NOTIFY_ERROR, - _( "Connection error" ), - buffer, - "%s", - host.message); - - lib3270_set_disconnected(hSession); + connection_failed(hSession,host.message); return errno = ENOTCONN; } diff --git a/src/core/popup.c b/src/core/popup.c new file mode 100644 index 0000000..501e051 --- /dev/null +++ b/src/core/popup.c @@ -0,0 +1,118 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + +/** + * @file popup.c + * + * @brief A callback based popup dialog engine. + * + */ + +#include +#include +#include +#include + +/*--[ Implement ]------------------------------------------------------------------------------------*/ + +/// @brief Pop up an error dialog. +void popup_an_error(H3270 *hSession, const char *fmt, ...) +{ + + lib3270_autoptr(char) summary = NULL; + + if(fmt) + { + va_list args; + va_start(args, fmt); + summary = lib3270_vsprintf(fmt,args); + va_end(args); + } + + LIB3270_POPUP popup = { + .type = LIB3270_NOTIFY_ERROR, + .summary = summary + }; + + hSession->cbk.popup_show(hSession,&popup,0); + +} + +void popup_system_error(H3270 *hSession, const char *title, const char *summary, const char *fmt, ...) +{ + + lib3270_autoptr(char) body = NULL; + + if(fmt) + { + va_list args; + va_start(args, fmt); + body = lib3270_vsprintf(fmt,args); + va_end(args); + } + + LIB3270_POPUP popup = { + .type = LIB3270_NOTIFY_ERROR, + .title = title, + .summary = summary, + .body = body + }; + + hSession->cbk.popup_show(hSession,&popup,0); + +} + +LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + lib3270_popup_va(session, id, title, message, fmt, args); + va_end(args); +} + +LIB3270_EXPORT void lib3270_popup_va(H3270 *hSession, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, va_list args) +{ + CHECK_SESSION_HANDLE(hSession); + + lib3270_autoptr(char) body = NULL; + + if(fmt) { + body = lib3270_vsprintf(fmt,args); + } + + LIB3270_POPUP popup = { + .type = id, + .title = title, + .summary = message, + .body = body + }; + + hSession->cbk.popup_show(hSession,&popup,0); + +} diff --git a/src/core/screen.c b/src/core/screen.c index ede5cd3..9869ae2 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -726,115 +726,6 @@ static void status_3270_mode(H3270 *hSession, int GNUC_UNUSED(ignored), void GNU } -/* -static void status_printer(H3270 *session, int on, void *dunno) -{ - set_status(session,LIB3270_FLAG_PRINTER,on); -} -*/ - -/* -void status_timing(H3270 GNUC_UNUSED(*session), struct timeval GNUC_UNUSED(*t0), struct timeval GNUC_UNUSED(*t1)) -{ -} - -void status_untiming(H3270 *session) -{ - CHECK_SESSION_HANDLE(session); - - if(session->cbk.set_timer) - session->cbk.set_timer(session,0); -} -*/ - -/* -static int logpopup(H3270 *session, void *widget, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg) -{ -#ifdef ANDROID - char *mask = xs_buffer("%s\n",fmt); - __android_log_vprint(ANDROID_LOG_VERBOSE, PACKAGE_NAME, mask, arg); - lib3270_free(mask); -#else - lib3270_write_log(session,"popup","%s",title); - lib3270_write_log(session,"popup","%s",msg); - lib3270_write_va_log(session,"popup",fmt,arg); -#endif // ANDROID - return 0; -} -*/ - -void Error(H3270 *session, const char *fmt, ...) -{ - va_list arg_ptr; - - CHECK_SESSION_HANDLE(session); - - trace("%s: title=%s fmt=%s",__FUNCTION__,"3270 Error",fmt); - - va_start(arg_ptr, fmt); - - session->popups++; - session->cbk.popup(session,LIB3270_NOTIFY_ERROR, _( "3270 Error" ),NULL,fmt,arg_ptr); - session->popups--; - - va_end(arg_ptr); - -} - -void Warning(H3270 *session, const char *fmt, ...) -{ - va_list arg_ptr; - - CHECK_SESSION_HANDLE(session); - - trace("%s: title=%s fmt=%s",__FUNCTION__,"3270 Warning",fmt); - - va_start(arg_ptr, fmt); - - session->popups++; - session->cbk.popup(session,LIB3270_NOTIFY_WARNING, _( "3270 Warning" ),NULL,fmt,arg_ptr); - session->popups--; - - va_end(arg_ptr); - -} - -/* Pop up an error dialog. */ -void popup_an_error(H3270 *session, const char *fmt, ...) -{ - va_list args; - - CHECK_SESSION_HANDLE(session); - - trace("%s: title=%s fmt=%s",__FUNCTION__,"3270 Error",fmt); - - va_start(args, fmt); - - session->popups++; - session->cbk.popup(session,LIB3270_NOTIFY_ERROR,_( "3270 Error" ),NULL,fmt,args); - session->popups--; - - va_end(args); - -} - -void popup_system_error(H3270 *session, const char *title, const char *message, const char *fmt, ...) -{ - va_list args; - - CHECK_SESSION_HANDLE(session); - - trace("%s: title=%s msg=%s",__FUNCTION__,"3270 Error",message); - - va_start(args, fmt); - - session->popups++; - session->cbk.popup(session,LIB3270_NOTIFY_ERROR,title ? title : _( "3270 Error" ), message,fmt,args); - session->popups--; - - va_end(args); -} - void mcursor_set(H3270 *hSession,LIB3270_POINTER m) { if(hSession->pointer != ((unsigned short) m)) { @@ -961,20 +852,3 @@ LIB3270_EXPORT int lib3270_testpattern(H3270 *hSession) return 0; } -LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - lib3270_popup_va(session, id, title, message, fmt, args); - va_end(args); -} - -LIB3270_EXPORT void lib3270_popup_va(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, va_list args) -{ - CHECK_SESSION_HANDLE(session); - - session->popups++; - session->cbk.popup(session,id,title ? title : _( "3270 Error" ), message,fmt,args); - session->popups--; - -} diff --git a/src/core/session.c b/src/core/session.c index f5e94d2..3d78a3a 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -220,28 +220,26 @@ static void message(H3270 *session, LIB3270_NOTIFY GNUC_UNUSED(id), const char * #endif // ANDROID } -static void def_popup(H3270 *session, LIB3270_NOTIFY GNUC_UNUSED(type), const char *title, const char *msg, const char *fmt, va_list arg) +static void def_popup(H3270 *hSession, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list args) { -#ifdef ANDROID - char *mask = xs_buffer("%s\n",fmt); - __android_log_vprint(ANDROID_LOG_VERBOSE, PACKAGE_NAME, mask, arg); - lib3270_free(mask); -#else - lib3270_write_log(session,"popup","%s",title); - lib3270_write_log(session,"popup","%s",msg); - lib3270_write_va_log(session,"popup",fmt,arg); -#endif // ANDROID + lib3270_popup_va(hSession,type,title,msg,fmt,args); } static int def_popup_show(H3270 *hSession, const LIB3270_POPUP *popup, unsigned char GNUC_UNUSED wait) { - lib3270_popup_dialog( - hSession, - popup->type, + const char * text[] = { popup->title, popup->summary, - "%s", popup->body - ); + popup->body + }; + + size_t ix; + + for(ix = 0; ix < (sizeof(text)/sizeof(text[0])); ix++) + { + lib3270_write_log(hSession,"popup","%s",text[ix]); + } + return ENOTSUP; } diff --git a/src/core/telnet.c b/src/core/telnet.c index 5b8da4f..c19db4f 100644 --- a/src/core/telnet.c +++ b/src/core/telnet.c @@ -859,7 +859,12 @@ static int telnet_fsm(H3270 *hSession, unsigned char c) } else { - Warning(hSession, _( "EOR received when not in 3270 mode, ignored." )); + lib3270_popup_dialog( + hSession, + LIB3270_NOTIFY_WARNING,_("Warning"), + _( "EOR received when not in 3270 mode, ignored." ), + NULL + ); } trace_dsn(hSession,"RCVD EOR\n"); hSession->ibptr = hSession->ibuf; diff --git a/src/core/toggles/init.c b/src/core/toggles/init.c index 5a3ca17..2564ef5 100644 --- a/src/core/toggles/init.c +++ b/src/core/toggles/init.c @@ -98,7 +98,7 @@ static void toggle_keepalive(H3270 *session, const struct lib3270_toggle GNUC_UN static void toggle_connect(H3270 *hSession, const struct lib3270_toggle *toggle, LIB3270_TOGGLE_TYPE tt) { - if(tt != LIB3270_TOGGLE_TYPE_INITIAL && lib3270_is_disconnected(hSession) && !hSession->popups && toggle->value) + if(tt != LIB3270_TOGGLE_TYPE_INITIAL && lib3270_is_disconnected(hSession) && toggle->value) { if(lib3270_reconnect(hSession,0)) lib3270_write_log(hSession,"3270","Auto-connect fails: %s",strerror(errno)); diff --git a/src/core/util.c b/src/core/util.c index d164072..32cc6d7 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -56,7 +56,7 @@ char * lib3270_vsprintf(const char *fmt, va_list args) #if defined(HAVE_VASPRINTF) if(vasprintf(&r, fmt, args) < 0 || !r) - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); #else @@ -66,7 +66,7 @@ char * lib3270_vsprintf(const char *fmt, va_list args) nc = vsnprintf(buf, sizeof(buf), fmt, args); if(nc < 0) { - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); } else if (nc < sizeof(buf)) { @@ -78,7 +78,7 @@ char * lib3270_vsprintf(const char *fmt, va_list args) { r = lib3270_malloc(nc + 1); if(vsnprintf(r, nc, fmt, args) < 0) - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); } @@ -115,9 +115,10 @@ char * xs_buffer(const char *fmt, ...) return r; } -/* Common uses of xs_buffer. */ -void -xs_warning(const char *fmt, ...) +// Common uses of xs_buffer. + +/* +void xs_warning(const char *fmt, ...) { va_list args; char *r; @@ -125,12 +126,11 @@ xs_warning(const char *fmt, ...) va_start(args, fmt); r = lib3270_vsprintf(fmt, args); va_end(args); - Warning(NULL,r); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_WARNING,_("Warning"),r,NULL); lib3270_free(r); } -void -xs_error(const char *fmt, ...) +void xs_error(const char *fmt, ...) { va_list args; char *r; @@ -138,9 +138,10 @@ xs_error(const char *fmt, ...) va_start(args, fmt); r = lib3270_vsprintf(fmt, args); va_end(args); - Error(NULL,r); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Error"),r,NULL); lib3270_free(r); } +*/ /** * @brief Expands a character in the manner of "cat -v". @@ -318,7 +319,7 @@ LIB3270_EXPORT void * lib3270_realloc(void *p, int len) { p = realloc(p, len); if(!p) - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); return p; } @@ -334,7 +335,7 @@ LIB3270_EXPORT void * lib3270_calloc(int elsize, int nelem, void *ptr) if(ptr) memset(ptr,0,sz); else - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); return ptr; } @@ -346,7 +347,7 @@ LIB3270_EXPORT void * lib3270_malloc(int len) r = malloc(len); if (r == (char *)NULL) { - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); return 0; } @@ -361,7 +362,7 @@ LIB3270_EXPORT void * lib3270_strdup(const char *str) r = strdup(str); if (r == (char *)NULL) { - Error(NULL,"Out of memory in %s",__FUNCTION__); + lib3270_popup_dialog(lib3270_get_default_session_handle(),LIB3270_NOTIFY_ERROR,_("Internal error"),"Out of memory",NULL); return 0; } diff --git a/src/core/windows/connect.c b/src/core/windows/connect.c index 0ac7536..971eee7 100644 --- a/src/core/windows/connect.c +++ b/src/core/windows/connect.c @@ -83,17 +83,9 @@ static void net_connected(H3270 *hSession, int GNUC_UNUSED(fd), LIB3270_IO_FLAG } else if(err) { - char buffer[4096]; - snprintf(buffer,4095,_( "Can't connect to %s" ), lib3270_get_url(hSession) ); + lib3270_autoptr(char) body = lib3270_strdup_printf(_("%s (rc=%d)"),strerror(err),err); - lib3270_disconnect(hSession); - lib3270_popup_dialog( hSession, - LIB3270_NOTIFY_ERROR, - _( "Connection failed" ), - buffer, - _( "%s (rc=%d)"), strerror(err), err - ); - trace("%s",__FUNCTION__); + connection_failed(hSession,body); return; } @@ -229,10 +221,10 @@ int net_reconnect(H3270 *hSession, int seconds) if(lib3270_run_task(hSession, background_connect, &host) || hSession->connection.sock < 0) { - lib3270_autoptr(char) message = lib3270_strdup_printf(_( "Can't connect to %s"), lib3270_get_url(hSession)); - if(host.message) { + // Have windows message, convert charset. + char msg[4096]; strncpy(msg,host.message,4095); @@ -289,24 +281,12 @@ int net_reconnect(H3270 *hSession, int seconds) } #endif // HAVE_ICONV - lib3270_popup_dialog( hSession, - LIB3270_NOTIFY_ERROR, - _( "Connection error" ), - message, - "%s (rc=%d)", - msg, - host.rc - ); + connection_failed(hSession,msg); } else { - lib3270_popup_dialog( hSession, - LIB3270_NOTIFY_ERROR, - _( "Connection error" ), - message, - "%s", - NULL); + connection_failed(hSession,NULL); } lib3270_set_disconnected(hSession); diff --git a/src/include/internals.h b/src/include/internals.h index a08358b..39f772f 100644 --- a/src/include/internals.h +++ b/src/include/internals.h @@ -655,8 +655,6 @@ struct _h3270 void * except; } xio; - size_t popups; ///< @brief Count open popups. - #ifdef HAVE_LIBSSL /// @brief SSL Data. struct @@ -753,6 +751,7 @@ LIB3270_INTERNAL int lib3270_default_event_dispatcher(H3270 *hSession, int block LIB3270_INTERNAL int do_select(H3270 *h, unsigned int start, unsigned int end, unsigned int rect); +LIB3270_INTERNAL void connection_failed(H3270 *hSession, const char *message); /** * @brief Called from timer to attempt an automatic reconnection. @@ -840,7 +839,6 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); */ LIB3270_INTERNAL void ssl_popup_message(H3270 *hSession, const SSL_ERROR_MESSAGE *msg); - #endif /// @brief Clear element at adress. @@ -866,4 +864,3 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); /// @brief Fire CState change. LIB3270_INTERNAL int lib3270_set_cstate(H3270 *hSession, LIB3270_CSTATE cstate); - diff --git a/src/include/lib3270/popup.h b/src/include/lib3270/popup.h index de7edf8..a92c81c 100644 --- a/src/include/lib3270/popup.h +++ b/src/include/lib3270/popup.h @@ -106,7 +106,7 @@ * @brief Auto cleanup method (for use with lib3270_autoptr). * */ - LIB3270_EXPORT void lib3270_autoptr_cleanup_LIB3270_POPUP(LIB3270_POPUP **ptr); + LIB3270_EXPORT void lib3270_autoptr_cleanup_LIB3270_POPUP(LIB3270_POPUP **ptr); #ifdef __cplusplus } diff --git a/src/ssl/notify.c b/src/ssl/notify.c index f7f6c22..8d3c533 100644 --- a/src/ssl/notify.c +++ b/src/ssl/notify.c @@ -36,6 +36,7 @@ #include #include #include +#include /*--[ Implement ]------------------------------------------------------------------------------------*/ @@ -154,8 +155,9 @@ int popup_ssl_error(H3270 GNUC_UNUSED(*hSession), int rc, const SSL_ERROR_MESSAG void ssl_popup_message(H3270 *hSession, const SSL_ERROR_MESSAGE *msg) { - lib3270_autoptr(LIB3270_POPUP) * popup = translate_ssl_error_message(msg,0); + LIB3270_POPUP * popup = translate_ssl_error_message(msg,0); hSession->cbk.popup_show(hSession,popup,0); + lib3270_free(popup); } -- libgit2 0.21.2