1
0
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:
Phil 2008-03-29 02:19:36 +00:00
parent e306a2c2e8
commit ef3f404cca
2 changed files with 2 additions and 1 deletions

View File

@ -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,

View File

@ -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) {