mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
Two minor code cleanups and one NULL deref on error fix.
* common/estream.c (es_freopen): Remove useless check for STREAM. * kbx/keybox-blob.c (_keybox_create_x509_blob): Remove useless check for BLOB. * tools/sockprox.c (run_proxy): Do not fclose(NULL). -- Found by Hans-Christoph Steiner with cppcheck.
This commit is contained in:
parent
db3b528239
commit
a34afa8f20
@ -3101,7 +3101,7 @@ es_freopen (const char *ES__RESTRICT path, const char *ES__RESTRICT mode,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (stream && path)
|
if (path)
|
||||||
fname_set_internal (stream, path, 1);
|
fname_set_internal (stream, path, 1);
|
||||||
ESTREAM_UNLOCK (stream);
|
ESTREAM_UNLOCK (stream);
|
||||||
}
|
}
|
||||||
|
@ -948,12 +948,12 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, ksba_cert_t cert,
|
|||||||
leave:
|
leave:
|
||||||
release_kid_list (blob->temp_kids);
|
release_kid_list (blob->temp_kids);
|
||||||
blob->temp_kids = NULL;
|
blob->temp_kids = NULL;
|
||||||
if (blob && names)
|
if (names)
|
||||||
{
|
{
|
||||||
for (i=0; i < blob->nuids; i++)
|
for (i=0; i < blob->nuids; i++)
|
||||||
xfree (names[i]);
|
xfree (names[i]);
|
||||||
|
xfree (names);
|
||||||
}
|
}
|
||||||
xfree (names);
|
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
_keybox_release_blob (blob);
|
_keybox_release_blob (blob);
|
||||||
|
@ -443,7 +443,8 @@ run_proxy (void)
|
|||||||
out:
|
out:
|
||||||
|
|
||||||
pthread_attr_destroy (&thread_attr);
|
pthread_attr_destroy (&thread_attr);
|
||||||
fclose (protocol_file); /* FIXME, err checking. */
|
if (protocol_file)
|
||||||
|
fclose (protocol_file); /* FIXME, err checking. */
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user