From d1014c1cdfce116741ddd6eccd65b69530ce0b84 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 28 Jun 2006 00:50:14 +0000 Subject: r16582: Fix Klocwork #1997 and all generic class of problems where we don't correctly check the return from memdup. Jeremy. (This used to be commit ce14daf51c7ee2f9c68c77f7f4674e6f0e35c9ca) --- source3/libsmb/clirap.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 58fa9c8dff..26f22f2131 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -848,6 +848,12 @@ BOOL cli_qfileinfo_test(struct cli_state *cli, int fnum, int level, char **poutd } *poutdata = memdup(rdata, data_len); + if (!*poutdata) { + SAFE_FREE(rdata); + SAFE_FREE(rparam); + return False; + } + *poutlen = data_len; SAFE_FREE(rdata); -- cgit