bugGKSu - Bugs: bug #32347, I found something unoptimal in...

 
 

bug #32347: I found something unoptimal in sourcecode.

Submitted by:  None
Submitted on:  Fri 04 Feb 2011 01:39:23 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 04 Feb 2011 01:39:23 AM UTC, original submission:

I'm not a member of your community and wont to be him (at least at this time).
But I'm interested in your code. I found a part of it unoptimal (it's my opinion, it may be wrong, because i'm not qualified in programming - i'm just studying (and it's the reason for analysis of your source code)).

From words to action:

in libgksu.c:

/* we cannot pass 'password' as it has no \n */
pass = g_strdup_printf ("%s\n", password);
write (fdpty, pass, strlen(pass));

/* cleans the memory */
gksu_secure_free (pass);
gksu_secure_free (password);

may be:

write (fdpty, password, strlen(password));
write (fdpty, \n, 1);
gksu_secure_free (password);

we no need the `pass` variable, we no need `g_strdup_printf`.

Am I wrong?

P.S.
Sorry for my bad english.
My public e-mail: -unavailable-

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup