From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/PROBLEMS/lotto1.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 reference/C/PROBLEMS/lotto1.c (limited to 'reference/C/PROBLEMS/lotto1.c') diff --git a/reference/C/PROBLEMS/lotto1.c b/reference/C/PROBLEMS/lotto1.c new file mode 100644 index 0000000..5de3459 --- /dev/null +++ b/reference/C/PROBLEMS/lotto1.c @@ -0,0 +1,40 @@ +/************************************************************************ + * + * Purpose: First attempt at a lottery number selector. + * Author: M.J. Leslie. + * Date: 17-Nov-94 + * Description: Any 6 random numbers from 1 to 49 are displayed. + * Futures: Filter duplicates. + * Sort the result. + *************************************************************************/ + +#include +#include +#include + +#define NUMBERS 6 + +/************************************************************************/ +main() + { + int num; + + printf("\n\nLOTTERY CRACKER V1.0\n"); + printf("--------------------\n\n"); + printf("\tPossible winning ticket number is "); + /* New starting point + * for the random numbers + */ + srand((unsigned int)time((time_t *)NULL)); + + /* Display any 6 numbers. + * Duplicates are not filtered. + */ + for (num=0; num < NUMBERS; num++) + { + printf(" %02d", (rand()%49)+1); + } + + puts(""); + puts(""); + } -- cgit v1.2.3-54-g00ecf '>summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiping Zhang <liping.zhang@spreadtrum.com>2016-08-08 22:03:40 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-08-09 10:39:25 +0200
commitb18bcb0019cf57a3db0917b77e65c29bd9b00f54 (patch)
treee4953f2cfc6e10c6c7a19b0f02bef6eb951e367b
parentb173a28f62cf929324a8a6adcc45adadce311d16 (diff)
netfilter: nfnetlink_queue: fix memory leak when attach expectation successfully
User can use NFQA_EXP to attach expectations to conntracks, but we forget to put back nf_conntrack_expect when it is inserted successfully, i.e. in this normal case, expect's use refcnt will be 3. So even we unlink it and put it back later, the use refcnt is still 1, then the memory will be leaked forever. Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>