pointer, lest non-ANSI compliant systems like SunOS fail.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9998
dc483132-0cff-0310-8789-
dd5450dbe970
+Sun Mar 9 13:40:33 1997 Tom Yu <tlyu@mit.edu>
+
+ * svr_principal.c (add_to_history): Don't call realloc() on a NULL
+ pointer, lest non-ANSI compliant systems like SunOS fail.
+
Sat Feb 22 01:34:08 1997 Sam Hartman <hartmans@tertius.mit.edu>
* Makefile.in (SHLIB_EXPDEPS): s/.so/$(SHLIBEXT)
/* resize the adb->old_keys array if necessary */
if (adb->old_key_len < pol->pw_history_num-1) {
- adb->old_keys = (osa_pw_hist_ent *)
- realloc(adb->old_keys,
- (adb->old_key_len+1)*sizeof(osa_pw_hist_ent));
+ if (adb->old_keys == NULL) {
+ adb->old_keys = (osa_pw_hist_ent *)
+ malloc((adb->old_key_len + 1) * sizeof (osa_pw_hist_ent));
+ } else {
+ adb->old_keys = (osa_pw_hist_ent *)
+ realloc(adb->old_keys,
+ (adb->old_key_len + 1) * sizeof (osa_pw_hist_ent));
+ }
if (adb->old_keys == NULL)
return(ENOMEM);