[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-160-g556016d16
wwp at claws-mail.org
wwp at claws-mail.org
Sat Sep 11 23:06:23 CEST 2021
The branch, gtk3 has been updated
via 556016d16a3092260e5d83057939a1d44d088fdb (commit)
from 33c9a6ca39e04801e95332a4e0a087778ad8e760 (commit)
Summary of changes:
src/addritem.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 556016d16a3092260e5d83057939a1d44d088fdb
Author: wwp <subscript at free.fr>
Date: Sat Sep 11 23:05:22 2021 +0200
Fix CID 1491380: resource leak, and add few errors when allocating new
itemFolders weren't possible (this would lead to unpredictable behaviour
later, anyway).
diff --git a/src/addritem.c b/src/addritem.c
index 832a139fa..f0c26176a 100644
--- a/src/addritem.c
+++ b/src/addritem.c
@@ -788,6 +788,8 @@ void addritem_print_item_group( ItemGroup *group, FILE *stream ) {
ItemFolder *addritem_create_item_folder( void ) {
ItemFolder *folder;
folder = g_new0( ItemFolder, 1 );
+ if (!folder)
+ g_error("could not create new itemFolder");
ADDRITEM_TYPE(folder) = ITEMTYPE_FOLDER;
ADDRITEM_ID(folder) = NULL;
ADDRITEM_NAME(folder) = NULL;
@@ -812,14 +814,14 @@ ItemFolder *addritem_create_item_folder( void ) {
* \return A copy of the folder, or <i>NULL</i> if null argument supplied.
*/
ItemFolder *addritem_copy_item_folder( ItemFolder *item ) {
- ItemFolder *itemNew;
+ ItemFolder *itemNew = NULL;
- itemNew = g_new0( ItemFolder, 1 );
if( item ) {
itemNew = addritem_create_item_folder();
ADDRITEM_NAME(itemNew) = g_strdup( ADDRITEM_NAME(item) );
itemNew->folderType = item->folderType;
- }
+ } else
+ g_error("could not create a copy of a null itemFolder");
return itemNew;
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list