mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kdirshare: fix pointer derefence on serve or publish error
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
85e1e8a8ea
commit
6ce6615bd6
1 changed files with 4 additions and 2 deletions
|
@ -97,13 +97,15 @@ QString KDirShareModule::share(const QString &dirpath, const uint portmin, const
|
||||||
}
|
}
|
||||||
// qDebug() << Q_FUNC_INFO << serverport;
|
// qDebug() << Q_FUNC_INFO << serverport;
|
||||||
if (!kdirshareimpl->serve(QHostAddress(QHostAddress::Any), portmin, portmax)) {
|
if (!kdirshareimpl->serve(QHostAddress(QHostAddress::Any), portmin, portmax)) {
|
||||||
|
const QString serveerror = kdirshareimpl->errorString();
|
||||||
delete kdirshareimpl;
|
delete kdirshareimpl;
|
||||||
return i18n("Could not serve: %1", kdirshareimpl->errorString());
|
return i18n("Could not serve: %1", serveerror);
|
||||||
}
|
}
|
||||||
if (!kdirshareimpl->publish()) {
|
if (!kdirshareimpl->publish()) {
|
||||||
|
const QString publisherror = kdirshareimpl->publishError();
|
||||||
kdirshareimpl->stop();
|
kdirshareimpl->stop();
|
||||||
delete kdirshareimpl;
|
delete kdirshareimpl;
|
||||||
return i18n("Could not publish service: %1", kdirshareimpl->publishError());
|
return i18n("Could not publish service: %1", publisherror);
|
||||||
}
|
}
|
||||||
m_dirshares.append(kdirshareimpl);
|
m_dirshares.append(kdirshareimpl);
|
||||||
return QString();
|
return QString();
|
||||||
|
|
Loading…
Add table
Reference in a new issue