Merge pull request #2175 from cgwalters/coverity-2020.5

Two small Coverity fixes
This commit is contained in:
OpenShift Merge Robot 2020-08-19 16:46:49 +02:00 committed by GitHub
commit c61ff03304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -436,8 +436,9 @@ ensure_idle_queued (OtPullData *pull_data)
idle_src = g_idle_source_new ();
g_source_set_callback (idle_src, idle_worker, pull_data, NULL);
g_source_attach (idle_src, pull_data->main_context);
g_source_unref (idle_src);
pull_data->idle_src = idle_src;
/* Ownership is transferred to pull_data */
g_source_unref (idle_src);
}
typedef struct {

View File

@ -101,10 +101,9 @@ sysroot_is_configured_ro (const char *sysroot)
bool ret = false;
char *line = NULL;
size_t len = 0;
ssize_t nread;
/* Note getline() will reuse the previous buffer */
bool in_sysroot = false;
while ((nread = getline (&line, &len, f)) != -1)
while (getline (&line, &len, f) != -1)
{
/* This is an awful hack to avoid depending on GLib in the
* initramfs right now.