From f9236d1a0be70edcba7db7e8c51271d83b208f25 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Tue, 7 May 2013 11:49:54 +0200 Subject: [PATCH] Fix bug report --- console/linphonec.c | 3 +++ coreapi/message_storage.c | 4 ++-- coreapi/sal_eXosip2.c | 1 + coreapi/sal_eXosip2_sdp.c | 2 +- gtk/incall_view.c | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/console/linphonec.c b/console/linphonec.c index fca5a9b8..60c3c2af 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -1400,6 +1400,7 @@ copy_file(const char *from, const char *to) snprintf(message, 255, "Can't open %s for writing: %s\n", to, strerror(errno)); fprintf(stderr, "%s", message); + fclose(in); return 0; } @@ -1408,6 +1409,8 @@ copy_file(const char *from, const char *to) { if ( ! fwrite(buf, 1, n, out) ) { + fclose(in); + fclose(out); return 0; } } diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index 8ba642b6..deed140c 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -204,13 +204,13 @@ void linphone_create_table(sqlite3* db){ void linphone_core_message_storage_init(LinphoneCore *lc){ int ret; - char *errmsg=NULL; + const char *errmsg; sqlite3 *db; ret=sqlite3_open(lc->chat_db_file,&db); if(ret != SQLITE_OK) { + errmsg=sqlite3_errmsg(db); printf("Error in the opening: %s.\n", errmsg); sqlite3_close(db); - sqlite3_free(errmsg); } linphone_create_table(db); lc->db=db; diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 0c1b1244..284773c9 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -1464,6 +1464,7 @@ static bool_t call_failure(Sal *sal, eXosip_event_t *ev){ case 480: error=SalErrorFailure; sr=SalReasonTemporarilyUnavailable; + break; case 486: error=SalErrorFailure; sr=SalReasonBusy; diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index debd8550..54865aab 100644 --- a/coreapi/sal_eXosip2_sdp.c +++ b/coreapi/sal_eXosip2_sdp.c @@ -547,7 +547,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){ for (k=0;valid_count < SAL_CRYPTO_ALGO_MAX && (attr=sdp_message_attribute_get(msg,i,k))!=NULL;k++){ char tmp[256], tmp2[256]; if (keywordcmp("crypto",attr->a_att_field)==0 && attr->a_att_value!=NULL){ - int nb = sscanf(attr->a_att_value, "%d %256s inline:%256s", + int nb = sscanf(attr->a_att_value, "%d %255s inline:%255s", &stream->crypto[valid_count].tag, tmp, tmp2); diff --git a/gtk/incall_view.c b/gtk/incall_view.c index 5e13f260..da954a45 100644 --- a/gtk/incall_view.c +++ b/gtk/incall_view.c @@ -741,11 +741,12 @@ static gboolean in_call_view_terminated(LinphoneCall *call){ void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){ GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call); + if(callview==NULL) return; GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status"); guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid")); gboolean in_conf=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call)); - if ((callview==NULL) || (status==NULL)) return; + if (status==NULL) return; if (error_msg==NULL) gtk_label_set_markup(GTK_LABEL(status),_("Call ended.")); else{ -- 2.39.2