(get_errmsg): Check for errcode_2_string and release_errcode_string
authorKen Raeburn <raeburn@mit.edu>
Fri, 29 Sep 2006 23:07:19 +0000 (23:07 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 29 Sep 2006 23:07:19 +0000 (23:07 +0000)
being null function pointers.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18633 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/kdb5.c

index 6eddfaa904a6f5561e197e3b26168370d96e1f78..a20af6b17514a528f21c7a1a77341e858a489fd1 100644 (file)
@@ -585,10 +585,13 @@ get_errmsg (krb5_context kcontext, krb5_error_code err_code)
     /* Must be called with dal_handle->lib_handle locked!  */
     assert(kcontext->db_context != NULL);
     dal_handle = (kdb5_dal_handle *) kcontext->db_context;
+    if (dal_handle->lib_handle->vftabl.errcode_2_string == NULL)
+       return;
     e = dal_handle->lib_handle->vftabl.errcode_2_string(kcontext, err_code);
     assert (e != NULL);
     krb5_set_error_message(kcontext, err_code, "%s", e);
-    dal_handle->lib_handle->vftabl.release_errcode_string(kcontext, e);
+    if (dal_handle->lib_handle->vftabl.release_errcode_string)
+       dal_handle->lib_handle->vftabl.release_errcode_string(kcontext, e);
 }
 
 /*