Fully initialize handle data on allocation
authorKen Raeburn <raeburn@mit.edu>
Wed, 6 Aug 2008 16:43:44 +0000 (16:43 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 6 Aug 2008 16:43:44 +0000 (16:43 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20617 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/clnt/client_init.c

index 67a99e7fd9a61db11a9cde45e467bb2a3d976754..fc67ab2d7332d4dd4936375f3ef89f174d3988fc 100644 (file)
@@ -189,6 +189,7 @@ static kadm5_ret_t _kadm5_init_any(char *client_name,
      if (! (handle = malloc(sizeof(*handle)))) {
          return ENOMEM;
      }
+     memset(handle, 0, sizeof(*handle));
      if (! (handle->lhandle = malloc(sizeof(*handle)))) {
          free(handle);
          return ENOMEM;
@@ -200,6 +201,7 @@ static kadm5_ret_t _kadm5_init_any(char *client_name,
      handle->clnt = 0;
      handle->cache_name = 0;
      handle->destroy_cache = 0;
+     handle->context = 0;
      *handle->lhandle = *handle;
      handle->lhandle->api_version = KADM5_API_VERSION_2;
      handle->lhandle->struct_version = KADM5_STRUCT_VERSION;