mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
fix potential segfault in get_ioscheduler().
returning a const char * instead of a char * will lead to trouble if the string is then tried to be free()'d. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1056 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
e306a2c2e8
commit
ef3f404cca
@ -2,6 +2,7 @@
|
||||
|
||||
2008-03-29
|
||||
* Increased C99 compliance.
|
||||
* Fixed potential segfault in get_ioscheduler().
|
||||
|
||||
2008-03-28
|
||||
* Fixed messed up percentages (fs_free_perc, fs_used_perc, mpd_percent,
|
||||
|
@ -192,7 +192,7 @@ char *get_ioscheduler(char *disk)
|
||||
char buf[128];
|
||||
|
||||
if (!disk)
|
||||
return "n/a";
|
||||
return strdup("n/a");
|
||||
|
||||
snprintf(buf, 127, "/sys/block/%s/queue/scheduler", disk);
|
||||
if ((fp = fopen(buf, "r")) == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user