]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/hashed_db.c
ncurses 6.1 - patch 20181117
[ncurses.git] / ncurses / tinfo / hashed_db.c
index 730458503d6944ddb8ae66906749bb7c6c36445f..b59420585eac2ab7489983fa5d3d6cf782bca572 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2008,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-2011,2013 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -36,7 +36,7 @@
 
 #if USE_HASHED_DB
 
-MODULE_ID("$Id: hashed_db.c,v 1.15 2011/08/13 21:08:08 tom Exp $")
+MODULE_ID("$Id: hashed_db.c,v 1.17 2013/12/15 00:33:01 tom Exp $")
 
 #if HASHED_DB_API >= 2
 static DBC *cursor;
@@ -105,6 +105,8 @@ make_connection(DB * db, const char *path, bool modify)
        if (p->path != 0) {
            p->next = connections;
            connections = p;
+       } else {
+           free(p);
        }
     }
 }
@@ -284,7 +286,7 @@ NCURSES_EXPORT(bool)
 _nc_db_have_index(DBT * key, DBT * data, char **buffer, int *size)
 {
     bool result = FALSE;
-    int used = data->size - 1;
+    int used = (int) data->size - 1;
     char *have = (char *) data->data;
 
     (void) key;
@@ -307,7 +309,7 @@ NCURSES_EXPORT(bool)
 _nc_db_have_data(DBT * key, DBT * data, char **buffer, int *size)
 {
     bool result = FALSE;
-    int used = data->size - 1;
+    int used = (int) data->size - 1;
     char *have = (char *) data->data;
 
     if (*have++ == 0) {