b0f15a
When tcbdbopen fails to open a database file wrong pointer is returned
b0f15a
instead of NULL pointer.
b0f15a
b0f15a
Patch by Edgar Hoch
b0f15a
b0f15a
RHBZ#1004110
b0f15a
b0f15a
--- ypserv-2.31/lib/yp_db.c.orig	2013-04-10 16:42:21.000000000 +0200
b0f15a
+++ ypserv-2.31/lib/yp_db.c	2013-09-04 02:38:04.515428554 +0200
b0f15a
@@ -181,6 +181,12 @@ 
b0f15a
       	}
b0f15a
       else if (debug_flag)
b0f15a
 	log_msg ("\t\t->Returning OK!");
b0f15a
+      if ( !isok )
b0f15a
+	{
b0f15a
+	  /* DB not successful opened. Close database object and set return value to NULL. */
b0f15a
+	  tcbdbdel (dbp);
b0f15a
+	  dbp = NULL;
b0f15a
+	}
b0f15a
     }
b0f15a
   else
b0f15a
     {
b0f15a