]> sigrok.org Git - libsigrok.git/commitdiff
sr: session: Realloc correct array for pollfds in _sr_session_source_remove
authorLars-Peter Clausen <redacted>
Fri, 6 Jul 2012 21:23:29 +0000 (23:23 +0200)
committerUwe Hermann <redacted>
Tue, 10 Jul 2012 18:12:01 +0000 (20:12 +0200)
Commit 7149ad7c ("sr: session: Keep a global pollfd array") contained a small
copy paste error. This patch fixes it.

Signed-off-by: Lars-Peter Clausen <redacted>
session.c

index 9fc77659499c840cf734983c354d93486fa5f237..69b3321b2b0c5c5cf36214854ddf43d15a4312f6 100644 (file)
--- a/session.c
+++ b/session.c
@@ -605,7 +605,7 @@ static int _sr_session_source_remove(gintptr poll_object)
                        (num_sources - old) * sizeof(struct source));
        }
 
-       new_pollfds = g_try_realloc(sources, sizeof(GPollFD) * num_sources);
+       new_pollfds = g_try_realloc(pollfds, sizeof(GPollFD) * num_sources);
        if (!new_pollfds && num_sources > 0) {
                sr_err("session: %s: new_pollfds malloc failed", __func__);
                return SR_ERR_MALLOC;