memory leak and some unfinished code

Michal Seben mseben at suse.cz
Tue Oct 20 01:49:08 EDT 2009


We've received the following report from a reporter:
https://bugzilla.novell.com/show_bug.cgi?id=546014

-----------------------------------
function ArgusProcessSQLEvent
local variable is uid

>From the command line

$ fgrep uid ../BUILD/argus-clients-3.0.0/common/argus_event.c
   char mbuf[MAXSTRLEN], username[1024], *uid;
      accounts = getpwuid(geteuid())->pw_name;
                  if (row[0]) uid       = strdup((const char *)row [0]);

We can see that local variable uid is declared, line 2 is unrelated and line 3
has
a call to strdup.

Other than that, local variable uid is unused but causes a memory leak.
Suggest delete local variable uid.

In the same routine, local variables uid, name, fullname, address, telephone,
mobile, fax, email url, pass, filter and stat all seem to be set but never
used. It might be unfinished code, but suggest remove this code until it
is ready for use.
-----------------------------------

thanks




More information about the argus mailing list