summaryrefslogtreecommitdiffstats
path: root/loader/loader.c
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-10-14 16:39:27 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-10-14 17:58:40 -1000
commit4ac488330723ba9a60d668a0b9948bbb93268dae (patch)
treefda14bd4f22d202d0fc90ad29a8e696d9e10528d /loader/loader.c
parent6804bcd132c0d0406dd276dfe59e12d73b3b417c (diff)
downloadanaconda-4ac488330723ba9a60d668a0b9948bbb93268dae.tar.gz
anaconda-4ac488330723ba9a60d668a0b9948bbb93268dae.tar.xz
anaconda-4ac488330723ba9a60d668a0b9948bbb93268dae.zip
Let users go Back when loading updates.
If you select Back in loadUpdates(), the installer would segfault under certain cases.
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/loader/loader.c b/loader/loader.c
index f5e1db678..af9c531f0 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -417,6 +417,7 @@ void loadUpdates(struct loaderData_s *loaderData) {
if (rc == 1) {
device = strdup(devNames[0]);
free(devNames);
+ devNames = NULL;
if (dir == -1)
return;
@@ -435,11 +436,13 @@ void loadUpdates(struct loaderData_s *loaderData) {
if (rc == 2) {
free(devNames);
+ devNames = NULL;
return;
}
device = strdup(devNames[num]);
free(devNames);
+ devNames = NULL;
stage = UPD_PART;
}
@@ -447,12 +450,15 @@ void loadUpdates(struct loaderData_s *loaderData) {
char ** part_list = getPartitionsList(device);
int nump = 0, num = 0;
- if (part != NULL) free(part);
+ if (part != NULL) {
+ free(part);
+ part = NULL;
+ }
if ((nump = lenPartitionsList(part_list)) == 0) {
- if (dir == -1)
+ if (dir == -1) {
stage = UPD_DEVICE;
- else {
+ } else {
if (asprintf(&part, "/dev/%s", device) == -1) {
logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__);
abort();
@@ -492,6 +498,7 @@ void loadUpdates(struct loaderData_s *loaderData) {
rc = newtWinChoice(_("Updates Disk"), _("OK"), _("Back"), buf);
free(buf);
+ buf = NULL;
if (rc == 2) {
stage = UPD_PART;