diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2008-07-22 19:34:24 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2008-07-22 19:34:24 +0000 |
| commit | 4480e0df2a3d2fe2b63770e61d9cfd9fbe7d36fb (patch) | |
| tree | 67146989d784ae02cfee1b3595b2a5c8a7366b62 /src/util/support | |
| parent | ae629b14a7d2f1564d09f3ef49998ec7e35d2a27 (diff) | |
| download | krb5-4480e0df2a3d2fe2b63770e61d9cfd9fbe7d36fb.tar.gz krb5-4480e0df2a3d2fe2b63770e61d9cfd9fbe7d36fb.tar.xz krb5-4480e0df2a3d2fe2b63770e61d9cfd9fbe7d36fb.zip | |
Catch a few more cases of unchecked k5_mutex_lock calls
ticket: 5962
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20567 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/support')
| -rw-r--r-- | src/util/support/errors.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util/support/errors.c b/src/util/support/errors.c index 36ea11c3ad..d1aa485c5a 100644 --- a/src/util/support/errors.c +++ b/src/util/support/errors.c @@ -85,9 +85,11 @@ krb5int_get_error (struct errinfo *ep, long code) ep->msg = NULL; return ep->scratch_buf; } - lock(); + if (lock()) + goto no_fptr; if (fptr == NULL) { unlock(); + no_fptr: #ifdef HAVE_STRERROR_R if (strerror_r (code, ep->scratch_buf, sizeof(ep->scratch_buf)) == 0) { char *p = strdup(ep->scratch_buf); @@ -157,7 +159,8 @@ void krb5int_set_error_info_callout_fn (const char *(KRB5_CALLCONV *f)(long)) { initialize(); - lock(); - fptr = f; - unlock(); + if (lock() == 0) { + fptr = f; + unlock(); + } } |
