Blame SOURCES/ypserv-tcopenfail.patch

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